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AAmB7F,EAAeoJ,iBAC9C5D,E/C1FkD,S+C2FnD,CACA,IAAMokB,EAA6B,CAAEtoB,UAAWvB,EAAUkG,cAC1D,MAAM,IAAIhP,MAAMyD,KAAKC,UAAUivB,IAGjC1lB,EAAQwV,GAAc,qBAAsBwY,QAYhC,EAAAnd,YAAW,EA1C7B,CAAiB,EAAA5F,cAAA,EAAAA,YAAW,KA8DZ,EAAAgjB,iBAAhB,SAAiCx0B,GAC/B,OAAO,IAAIsG,SAAgB,SAAAC,GAEzB,GADAkB,KACK2P,IACH,MAAM1T,EAER6C,EAAQwV,GAAc,mBAAoB/b,QAY9B,EAAAoX,YAAW,EAjF7B,CAAiB,EAAAjG,YAAA,EAAAA,UAAS,KArF5B,CAAiBI,KAAAA,GAAK,M","sources":["webpack://microsoftTeams/webpack/universalModuleDefinition","webpack://microsoftTeams/../../node_modules/uuid/index.js","webpack://microsoftTeams/../../node_modules/uuid/lib/bytesToUuid.js","webpack://microsoftTeams/../../node_modules/uuid/lib/rng-browser.js","webpack://microsoftTeams/../../node_modules/uuid/v1.js","webpack://microsoftTeams/../../node_modules/uuid/v4.js","webpack://microsoftTeams/./node_modules/debug/src/browser.js","webpack://microsoftTeams/./node_modules/debug/src/common.js","webpack://microsoftTeams/./node_modules/ms/index.js","webpack://microsoftTeams/webpack/bootstrap","webpack://microsoftTeams/webpack/runtime/define property getters","webpack://microsoftTeams/webpack/runtime/hasOwnProperty shorthand","webpack://microsoftTeams/webpack/runtime/make namespace object","webpack://microsoftTeams/./src/internal/constants.ts","webpack://microsoftTeams/./src/public/interfaces.ts","webpack://microsoftTeams/./src/public/constants.ts","webpack://microsoftTeams/./src/internal/globalVars.ts","webpack://microsoftTeams/./src/public/authentication.ts","webpack://microsoftTeams/./src/internal/utils.ts","webpack://microsoftTeams/./src/internal/internalAPIs.ts","webpack://microsoftTeams/./src/private/privateAPIs.ts","webpack://microsoftTeams/./src/public/runtime.ts","webpack://microsoftTeams/./src/public/dialog.ts","webpack://microsoftTeams/./src/public/menus.ts","webpack://microsoftTeams/./src/public/teamsAPIs.ts","webpack://microsoftTeams/./src/public/app.ts","webpack://microsoftTeams/./src/public/pages.ts","webpack://microsoftTeams/./src/internal/telemetry.ts","webpack://microsoftTeams/./src/internal/handlers.ts","webpack://microsoftTeams/./src/internal/communication.ts","webpack://microsoftTeams/./src/private/logs.ts","webpack://microsoftTeams/./src/private/interfaces.ts","webpack://microsoftTeams/./src/private/conversations.ts","webpack://microsoftTeams/./src/internal/deepLinkConstants.ts","webpack://microsoftTeams/./src/public/appInstallDialog.ts","webpack://microsoftTeams/./src/public/chat.ts","webpack://microsoftTeams/./src/internal/deepLinkUtilities.ts","webpack://microsoftTeams/./src/public/appWindow.ts","webpack://microsoftTeams/./src/internal/mediaUtil.ts","webpack://microsoftTeams/./src/public/media.ts","webpack://microsoftTeams/./src/public/location.ts","webpack://microsoftTeams/./src/public/meeting.ts","webpack://microsoftTeams/./src/public/monetization.ts","webpack://microsoftTeams/./src/public/calendar.ts","webpack://microsoftTeams/./src/public/mail.ts","webpack://microsoftTeams/./src/public/people.ts","webpack://microsoftTeams/./src/public/video.ts","webpack://microsoftTeams/./src/public/sharing.ts","webpack://microsoftTeams/./src/public/stageView.ts","webpack://microsoftTeams/./src/public/call.ts","webpack://microsoftTeams/./src/public/appInitialization.ts","webpack://microsoftTeams/./src/public/settings.ts","webpack://microsoftTeams/./src/public/publicAPIs.ts","webpack://microsoftTeams/./src/public/navigation.ts","webpack://microsoftTeams/./src/public/tasks.ts","webpack://microsoftTeams/./src/private/files.ts","webpack://microsoftTeams/./src/private/meetingRoom.ts","webpack://microsoftTeams/./src/private/notifications.ts","webpack://microsoftTeams/./src/private/remoteCamera.ts","webpack://microsoftTeams/./src/private/appEntity.ts","webpack://microsoftTeams/./src/private/teams.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"microsoftTeams\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"microsoftTeams\"] = factory();\n\telse\n\t\troot[\"microsoftTeams\"] = factory();\n})(self, function() {\nreturn ","var v1 = require('./v1');\nvar v4 = require('./v4');\n\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\n\nmodule.exports = uuid;\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/uuidjs/uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","declare const PACKAGE_VERSION: string;\r\nexport const version = PACKAGE_VERSION;\r\n\r\n/**\r\n * @hidden\r\n * The client version when all SDK APIs started to check platform compatibility for the APIs was 1.6.0.\r\n * Modified to 2.0.1 which is hightest till now so that if any client doesn't pass version in initialize function, it will be set to highest.\r\n * Mobile clients are passing versions, hence will be applicable to web and desktop clients only.\r\n *\r\n * @internal\r\n */\r\nexport const defaultSDKVersionForCompatCheck = '2.0.1';\r\n\r\n/**\r\n * @hidden\r\n * This is the client version when selectMedia API - VideoAndImage is supported on mobile.\r\n *\r\n * @internal\r\n */\r\nexport const videoAndImageMediaAPISupportVersion = '2.0.2';\r\n\r\n/**\r\n * This is the client version when selectMedia API - Video with non-full screen mode is supported on mobile.\r\n */\r\nexport const nonFullScreenVideoModeAPISupportVersion = '2.0.3';\r\n\r\n/**\r\n * This is the client version when selectMedia API - ImageOutputFormats is supported on mobile.\r\n */\r\nexport const imageOutputFormatsAPISupportVersion = '2.0.4';\r\n\r\n/**\r\n * @hidden\r\n * Minimum required client supported version for {@link getUserJoinedTeams} to be supported on {@link HostClientType.android}\r\n *\r\n * @internal\r\n */\r\nexport const getUserJoinedTeamsSupportedAndroidClientVersion = '2.0.1';\r\n\r\n/**\r\n * @hidden\r\n * This is the client version when location APIs (getLocation and showLocation) are supported.\r\n *\r\n * @internal\r\n */\r\nexport const locationAPIsRequiredVersion = '1.9.0';\r\n\r\n/**\r\n * @hidden\r\n * This is the client version when people picker API is supported on mobile.\r\n *\r\n * @internal\r\n */\r\nexport const peoplePickerRequiredVersion = '2.0.0';\r\n\r\n/**\r\n * @hidden\r\n * This is the client version when captureImage API is supported on mobile.\r\n *\r\n * @internal\r\n */\r\nexport const captureImageMobileSupportVersion = '1.7.0';\r\n\r\n/**\r\n * @hidden\r\n * This is the client version when media APIs are supported on all three platforms ios, android and web.\r\n *\r\n * @internal\r\n */\r\nexport const mediaAPISupportVersion = '1.8.0';\r\n\r\n/**\r\n * @hidden\r\n * This is the client version when getMedia API is supported via Callbacks on all three platforms ios, android and web.\r\n *\r\n * @internal\r\n */\r\nexport const getMediaCallbackSupportVersion = '2.0.0';\r\n\r\n/**\r\n * @hidden\r\n * This is the client version when scanBarCode API is supported on mobile.\r\n *\r\n * @internal\r\n */\r\nexport const scanBarCodeAPIMobileSupportVersion = '1.9.0';\r\n\r\n/**\r\n * @hidden\r\n * List of supported Host origins\r\n *\r\n * @internal\r\n */\r\nexport const validOrigins = [\r\n 'teams.microsoft.com',\r\n 'teams.microsoft.us',\r\n 'gov.teams.microsoft.us',\r\n 'dod.teams.microsoft.us',\r\n 'int.teams.microsoft.com',\r\n 'teams.live.com',\r\n 'devspaces.skype.com',\r\n 'ssauth.skype.com',\r\n 'local.teams.live.com', // local development\r\n 'local.teams.live.com:8080', // local development\r\n 'local.teams.office.com', // local development\r\n 'local.teams.office.com:8080', // local development\r\n 'msft.spoppe.com',\r\n '*.sharepoint.com',\r\n '*.sharepoint-df.com',\r\n '*.sharepointonline.com',\r\n 'outlook.office.com',\r\n 'outlook-sdf.office.com',\r\n 'outlook.office365.com',\r\n 'outlook-sdf.office365.com',\r\n '*.teams.microsoft.com',\r\n 'www.office.com',\r\n 'word.office.com',\r\n 'excel.office.com',\r\n 'powerpoint.office.com',\r\n 'www.officeppe.com',\r\n '*.www.office.com',\r\n];\r\n\r\n/**\r\n * @hidden\r\n * USer specified message origins should satisfy this test\r\n *\r\n * @internal\r\n */\r\nexport const userOriginUrlValidationRegExp = /^https:\\/\\//;\r\n\r\n/**\r\n * @hidden\r\n * The protocol used for deep links into Teams\r\n *\r\n * @internal\r\n */\r\nexport const teamsDeepLinkProtocol = 'https';\r\n\r\n/**\r\n * @hidden\r\n * The host used for deep links into Teams\r\n *\r\n * @internal\r\n */\r\nexport const teamsDeepLinkHost = 'teams.microsoft.com';\r\n","/* eslint-disable @typescript-eslint/no-explicit-any*/\r\n\r\nimport { ChannelType, DialogDimension, HostClientType, HostName, TeamType, UserTeamRole } from './constants';\r\nimport { FrameContexts } from './constants';\r\n\r\n/**\r\n * Represents information about tabs for an app\r\n */\r\nexport interface TabInformation {\r\n teamTabs: TabInstance[];\r\n}\r\n\r\n/**\r\n * Represents information about a tab instance\r\n */\r\nexport interface TabInstance {\r\n /**\r\n * The name of the tab\r\n */\r\n tabName: string;\r\n\r\n /**\r\n * @internal\r\n * @protected\r\n */\r\n internalTabInstanceId?: string;\r\n\r\n /**\r\n * Last viewed time of this tab. null means unknown\r\n */\r\n lastViewUnixEpochTime?: string;\r\n\r\n /**\r\n * The developer-defined unique ID for the entity this content points to.\r\n */\r\n entityId?: string;\r\n\r\n /**\r\n * The Microsoft Teams ID for the channel with which the content is associated.\r\n */\r\n channelId?: string;\r\n\r\n /**\r\n * The name for the channel with which the content is associated.\r\n */\r\n channelName?: string;\r\n\r\n /**\r\n * Is this tab in a favorite channel?\r\n */\r\n channelIsFavorite?: boolean;\r\n\r\n /**\r\n * The Microsoft Teams ID for the team with which the content is associated.\r\n */\r\n teamId?: string;\r\n\r\n /**\r\n * The name for the team with which the content is associated.\r\n */\r\n teamName?: string;\r\n\r\n /**\r\n * Is this tab in a favorite team?\r\n */\r\n teamIsFavorite?: boolean;\r\n\r\n /**\r\n * The Office 365 group ID for the team with which the content is associated.\r\n * This field is available only when the identity permission is requested in the manifest.\r\n */\r\n groupId?: string;\r\n\r\n /**\r\n * Content URL of this tab\r\n */\r\n url?: string;\r\n\r\n /**\r\n * Website URL of this tab\r\n */\r\n websiteUrl?: string;\r\n}\r\n\r\n/**\r\n * Indicates information about the tab instance for filtering purposes.\r\n */\r\nexport interface TabInstanceParameters {\r\n /**\r\n * Flag allowing to select favorite channels only\r\n */\r\n favoriteChannelsOnly?: boolean;\r\n\r\n /**\r\n * Flag allowing to select favorite teams only\r\n */\r\n favoriteTeamsOnly?: boolean;\r\n}\r\n\r\n/**\r\n * Represents Team Information\r\n */\r\nexport interface TeamInformation {\r\n /**\r\n * Id of the team\r\n */\r\n teamId: string;\r\n\r\n /**\r\n * Team display name\r\n */\r\n teamName: string;\r\n\r\n /**\r\n * Team description\r\n */\r\n teamDescription?: string;\r\n\r\n /**\r\n * Thumbnail Uri\r\n */\r\n thumbnailUri?: string;\r\n\r\n /**\r\n * The Office 365 group ID for the team with which the content is associated.\r\n * This field is available only when the identity permission is requested in the manifest.\r\n */\r\n groupId?: string;\r\n\r\n /**\r\n * Role of current user in the team\r\n */\r\n userTeamRole?: UserTeamRole;\r\n\r\n /**\r\n * The type of the team.\r\n */\r\n teamType?: TeamType;\r\n\r\n /**\r\n * The locked status of the team\r\n */\r\n isTeamLocked?: boolean;\r\n\r\n /**\r\n * The archived status of the team\r\n */\r\n isTeamArchived?: boolean;\r\n}\r\n\r\n/**\r\n * Represents OS locale info used for formatting date and time data\r\n */\r\nexport interface LocaleInfo {\r\n platform: 'windows' | 'macos';\r\n regionalFormat: string;\r\n shortDate: string;\r\n longDate: string;\r\n shortTime: string;\r\n longTime: string;\r\n}\r\n\r\n/**\r\n * Allowed user file open preferences\r\n */\r\nexport enum FileOpenPreference {\r\n Inline = 'inline',\r\n Desktop = 'desktop',\r\n Web = 'web',\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link app.Context} instead.\r\n *\r\n * @remarks\r\n * For more details on the updated {@link app.Context} interface, visit\r\n * {@link https://docs.microsoft.com/microsoftteams/platform/tabs/how-to/using-teams-client-sdk#updates-to-the-context-interface}.\r\n *\r\n * Represents the structure of the received context message.\r\n */\r\nexport interface Context {\r\n /**\r\n * @hidden\r\n * The Office 365 group ID for the team with which the content is associated.\r\n * This field is available only when the identity permission is requested in the manifest.\r\n */\r\n groupId?: string;\r\n\r\n /**\r\n * @hidden\r\n * The Microsoft Teams ID for the team with which the content is associated.\r\n */\r\n teamId?: string;\r\n\r\n /**\r\n * @hidden\r\n * The name for the team with which the content is associated.\r\n */\r\n teamName?: string;\r\n\r\n /**\r\n * @hidden\r\n * The Microsoft Teams ID for the channel with which the content is associated.\r\n */\r\n channelId?: string;\r\n\r\n /**\r\n * @hidden\r\n * The name for the channel with which the content is associated.\r\n */\r\n channelName?: string;\r\n\r\n /**\r\n * @hidden\r\n * The type of the channel with which the content is associated.\r\n */\r\n channelType?: ChannelType;\r\n\r\n /**\r\n * @hidden\r\n * The developer-defined unique ID for the entity this content points to.\r\n */\r\n entityId: string;\r\n\r\n /**\r\n * @hidden\r\n * The developer-defined unique ID for the sub-entity this content points to.\r\n * This field should be used to restore to a specific state within an entity,\r\n * such as scrolling to or activating a specific piece of content.\r\n */\r\n subEntityId?: string;\r\n\r\n /**\r\n * @hidden\r\n * The current locale that the user has configured for the app formatted as\r\n * languageId-countryId (for example, en-us).\r\n */\r\n locale: string;\r\n\r\n /**\r\n * @hidden\r\n * More detailed locale info from the user's OS if available. Can be used together with\r\n * the @microsoft/globe NPM package to ensure your app respects the user's OS date and\r\n * time format configuration\r\n */\r\n osLocaleInfo?: LocaleInfo;\r\n\r\n /**\r\n * @hidden\r\n * @deprecated\r\n * As of 2.0.0, please use {@link loginHint} or {@link userPrincipalName} instead.\r\n * The UPN of the current user.\r\n * Because a malicious party can run your content in a browser, this value should\r\n * be used only as a hint as to who the user is and never as proof of identity.\r\n * This field is available only when the identity permission is requested in the manifest.\r\n */\r\n upn?: string;\r\n\r\n /**\r\n * @hidden\r\n * The Azure AD tenant ID of the current user.\r\n * Because a malicious party can run your content in a browser, this value should\r\n * be used only as a hint as to who the user is and never as proof of identity.\r\n * This field is available only when the identity permission is requested in the manifest.\r\n */\r\n tid?: string;\r\n\r\n /**\r\n * @hidden\r\n * The current UI theme.\r\n */\r\n theme?: string;\r\n\r\n /**\r\n * @hidden\r\n * Indication whether the tab is in full-screen mode.\r\n */\r\n isFullScreen?: boolean;\r\n\r\n /**\r\n * @hidden\r\n * The type of the team.\r\n */\r\n teamType?: TeamType;\r\n\r\n /**\r\n * @hidden\r\n * The root SharePoint site associated with the team.\r\n */\r\n teamSiteUrl?: string;\r\n\r\n /**\r\n * @hidden\r\n * The domain of the root SharePoint site associated with the team.\r\n */\r\n teamSiteDomain?: string;\r\n\r\n /**\r\n * @hidden\r\n * The relative path to the SharePoint site associated with the team.\r\n */\r\n teamSitePath?: string;\r\n\r\n /**\r\n * @hidden\r\n * The tenant ID of the host team.\r\n */\r\n hostTeamTenantId?: string;\r\n\r\n /**\r\n * @hidden\r\n * The AAD group ID of the host team.\r\n */\r\n hostTeamGroupId?: string;\r\n\r\n /**\r\n * @hidden\r\n * The relative path to the SharePoint folder associated with the channel.\r\n */\r\n channelRelativeUrl?: string;\r\n\r\n /**\r\n * @hidden\r\n * Unique ID for the current Teams session for use in correlating telemetry data.\r\n */\r\n sessionId?: string;\r\n\r\n /**\r\n * @hidden\r\n * The user's role in the team.\r\n * Because a malicious party can run your content in a browser, this value should\r\n * be used only as a hint as to the user's role, and never as proof of her role.\r\n */\r\n userTeamRole?: UserTeamRole;\r\n\r\n /**\r\n * @hidden\r\n * The Microsoft Teams ID for the chat with which the content is associated.\r\n */\r\n chatId?: string;\r\n\r\n /**\r\n * @hidden\r\n * A value suitable for use as a login_hint when authenticating with Azure AD.\r\n * Because a malicious party can run your content in a browser, this value should\r\n * be used only as a hint as to who the user is and never as proof of identity.\r\n * This field is available only when the identity permission is requested in the manifest.\r\n */\r\n loginHint?: string;\r\n\r\n /**\r\n * @hidden\r\n * The UPN of the current user. This may be an externally-authenticated UPN (e.g., guest users).\r\n * Because a malicious party run your content in a browser, this value should\r\n * be used only as a hint as to who the user is and never as proof of identity.\r\n * This field is available only when the identity permission is requested in the manifest.\r\n */\r\n userPrincipalName?: string;\r\n\r\n /**\r\n * @hidden\r\n * The Azure AD object id of the current user.\r\n * Because a malicious party run your content in a browser, this value should\r\n * be used only as a hint as to who the user is and never as proof of identity.\r\n * This field is available only when the identity permission is requested in the manifest.\r\n */\r\n userObjectId?: string;\r\n\r\n /**\r\n * @hidden\r\n * Indicates whether team is archived.\r\n * Apps should use this as a signal to prevent any changes to content associated with archived teams.\r\n */\r\n isTeamArchived?: boolean;\r\n\r\n /**\r\n * @hidden\r\n * The name of the host client. Possible values are: Office, Orange, Outlook, Teams\r\n */\r\n hostName?: HostName;\r\n\r\n /**\r\n * @hidden\r\n * The type of the host client. Possible values are : android, ios, web, desktop, rigel(deprecated, use teamsRoomsWindows instead),\r\n * surfaceHub, teamsRoomsWindows, teamsRoomsAndroid, teamsPhones, teamsDisplays\r\n */\r\n hostClientType?: HostClientType;\r\n\r\n /**\r\n * @hidden\r\n * The context where tab url is loaded (content, task, setting, remove, sidePanel)\r\n */\r\n frameContext?: FrameContexts;\r\n\r\n /**\r\n * @hidden\r\n * SharePoint context. This is only available when hosted in SharePoint.\r\n */\r\n sharepoint?: any;\r\n\r\n /**\r\n * @hidden\r\n * The type of license for the current users tenant.\r\n */\r\n tenantSKU?: string;\r\n\r\n /**\r\n * @hidden\r\n * The license type for the current user.\r\n */\r\n userLicenseType?: string;\r\n\r\n /**\r\n * @hidden\r\n * The ID of the parent message from which this task module was launched.\r\n * This is only available in task modules launched from bot cards.\r\n */\r\n parentMessageId?: string;\r\n\r\n /**\r\n * @hidden\r\n * Current ring ID\r\n */\r\n ringId?: string;\r\n\r\n /**\r\n * @hidden\r\n * Unique ID for the current session for use in correlating telemetry data.\r\n */\r\n appSessionId?: string;\r\n\r\n /**\r\n * @hidden\r\n * ID for the current visible app which is different for across cached sessions. Used for correlating telemetry data``\r\n */\r\n appLaunchId?: string;\r\n\r\n /**\r\n * @hidden\r\n * Represents whether calling is allowed for the current logged in User\r\n */\r\n isCallingAllowed?: boolean;\r\n\r\n /**\r\n * @hidden\r\n * Represents whether PSTN calling is allowed for the current logged in User\r\n */\r\n isPSTNCallingAllowed?: boolean;\r\n\r\n /**\r\n * @hidden\r\n * Meeting Id used by tab when running in meeting context\r\n */\r\n meetingId?: string;\r\n\r\n /**\r\n * @hidden\r\n * The OneNote section ID that is linked to the channel.\r\n */\r\n defaultOneNoteSectionId?: string;\r\n\r\n /**\r\n * @hidden\r\n * Indication whether the tab is in a pop out window\r\n */\r\n isMultiWindow?: boolean;\r\n\r\n /**\r\n * @hidden\r\n * Personal app icon y coordinate position\r\n */\r\n appIconPosition?: number;\r\n\r\n /**\r\n * @hidden\r\n * Source origin from where the tab is opened\r\n */\r\n sourceOrigin?: string;\r\n\r\n /**\r\n * @hidden\r\n * Time when the user clicked on the tab\r\n */\r\n userClickTime?: number;\r\n\r\n /**\r\n * @hidden\r\n * Team Template ID if there was a Team Template associated with the creation of the team.\r\n */\r\n teamTemplateId?: string;\r\n\r\n /**\r\n * @hidden\r\n * Where the user prefers the file to be opened from by default during file open\r\n */\r\n userFileOpenPreference?: FileOpenPreference;\r\n\r\n /**\r\n * @hidden\r\n * The address book name of the current user.\r\n */\r\n userDisplayName?: string;\r\n\r\n /**\r\n * @hidden\r\n * Teamsite ID, aka sharepoint site id.\r\n */\r\n teamSiteId?: string;\r\n\r\n /**\r\n * @hidden\r\n * The SharePoint my site domain associated with the user.\r\n */\r\n mySiteDomain?: string;\r\n\r\n /**\r\n * @hidden\r\n * The SharePoint relative path to the current users mysite\r\n */\r\n mySitePath?: string;\r\n}\r\n\r\nexport interface ShareDeepLinkParameters {\r\n /**\r\n * The developer-defined unique ID for the sub-page to which this deep link points in the current page.\r\n * This field should be used to restore to a specific state within a page, such as scrolling to or activating a specific piece of content.\r\n */\r\n subPageId: string;\r\n\r\n /**\r\n * The label for the sub-page that should be displayed when the deep link is rendered in a client.\r\n */\r\n subPageLabel: string;\r\n\r\n /**\r\n * The fallback URL to which to navigate the user if the client cannot render the page.\r\n * This URL should lead directly to the sub-entity.\r\n */\r\n subPageWebUrl?: string;\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link ShareDeepLinkParameters} instead.\r\n */\r\nexport interface DeepLinkParameters {\r\n /**\r\n * The developer-defined unique ID for the sub-entity to which this deep link points in the current entity.\r\n * This field should be used to restore to a specific state within an entity, such as scrolling to or activating a specific piece of content.\r\n */\r\n subEntityId: string;\r\n\r\n /**\r\n * The label for the sub-entity that should be displayed when the deep link is rendered in a client.\r\n */\r\n subEntityLabel: string;\r\n\r\n /**\r\n * The fallback URL to which to navigate the user if the client cannot render the page.\r\n * This URL should lead directly to the sub-entity.\r\n */\r\n subEntityWebUrl?: string;\r\n}\r\n\r\n/**\r\n * Data structure to represent the size of a dialog\r\n */\r\nexport interface DialogSize {\r\n /**\r\n * The requested height of the webview/iframe.\r\n */\r\n height: DialogDimension | number;\r\n\r\n /**\r\n * The requested width of the webview/iframe.\r\n */\r\n width: DialogDimension | number;\r\n}\r\n\r\n/**\r\n * Data structure to describe dialog information needed to open a url based dialog.\r\n */\r\nexport interface UrlDialogInfo {\r\n /**\r\n * The url to be rendered in the webview/iframe.\r\n *\r\n * @remarks\r\n * The domain of the url must match at least one of the\r\n * valid domains specified in the validDomains block of the manifest\r\n */\r\n url: string;\r\n\r\n /*\r\n * The requested size of the dialog\r\n */\r\n size: DialogSize;\r\n\r\n /**\r\n * Title of the task module.\r\n */\r\n title?: string;\r\n\r\n /**\r\n * If client doesnt support the URL, the URL that needs to be opened in the browser.\r\n */\r\n fallbackUrl?: string;\r\n}\r\n\r\n/**\r\n * Data structure to describe dialog information needed to open a bot based dialog.\r\n */\r\nexport interface BotUrlDialogInfo extends UrlDialogInfo {\r\n /**\r\n * Specifies a bot ID to send the result of the user's interaction with the task module.\r\n * The bot will receive a task/complete invoke event with a JSON object\r\n * in the event payload.\r\n */\r\n completionBotId: string;\r\n}\r\n\r\nexport interface DialogInfo {\r\n /**\r\n * The url to be rendered in the webview/iframe.\r\n *\r\n * @remarks\r\n * The domain of the url must match at least one of the\r\n * valid domains specified in the validDomains block of the manifest\r\n */\r\n url?: string;\r\n\r\n /**\r\n * JSON defining an adaptive card.\r\n */\r\n card?: string;\r\n\r\n /**\r\n * The requested height of the webview/iframe.\r\n */\r\n height?: DialogDimension | number;\r\n\r\n /**\r\n * The requested width of the webview/iframe.\r\n */\r\n width?: DialogDimension | number;\r\n\r\n /**\r\n * Title of the task module.\r\n */\r\n title?: string;\r\n\r\n /**\r\n * If client doesnt support the URL, the URL that needs to be opened in the browser.\r\n */\r\n fallbackUrl?: string;\r\n\r\n /**\r\n * Specifies a bot ID to send the result of the user's interaction with the task module.\r\n * If specified, the bot will receive a task/complete invoke event with a JSON object\r\n * in the event payload.\r\n */\r\n completionBotId?: string;\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link DialogInfo} instead.\r\n */\r\nexport type TaskInfo = DialogInfo;\r\n\r\nexport interface DialogSize {\r\n height: DialogDimension | number;\r\n width: DialogDimension | number;\r\n}\r\n/**\r\n * @hidden\r\n * Hide from docs.\r\n *\r\n * @internal\r\n */\r\nexport interface LoadContext {\r\n /**\r\n * @hidden\r\n * The entity that is requested to be loaded\r\n */\r\n entityId: string;\r\n\r\n /**\r\n * @hidden\r\n * The content URL that is requested to be loaded\r\n */\r\n contentUrl: string;\r\n}\r\n\r\nexport interface FrameInfo {\r\n /**\r\n * The current URL that needs to be used in the iframe if the tab is reloaded\r\n */\r\n contentUrl: string;\r\n\r\n /**\r\n * The current URL that needs to be used for opening the website when the user clicks on 'Go to website'\r\n */\r\n websiteUrl: string;\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link FrameInfo} instead.\r\n */\r\nexport type FrameContext = FrameInfo;\r\n\r\nexport interface SdkError {\r\n /**\r\n error code\r\n */\r\n errorCode: ErrorCode;\r\n /**\r\n Optional description for the error. This may contain useful information for web-app developers.\r\n This string will not be localized and is not for end-user consumption. \r\n App should not depend on the string content. The exact value may change. This is only for debugging purposes.\r\n */\r\n message?: string;\r\n}\r\n\r\nexport enum ErrorCode {\r\n /**\r\n * API not supported in the current platform.\r\n */\r\n NOT_SUPPORTED_ON_PLATFORM = 100,\r\n /**\r\n * Internal error encountered while performing the required operation.\r\n */\r\n INTERNAL_ERROR = 500,\r\n /**\r\n * API is not supported in the current context\r\n */\r\n NOT_SUPPORTED_IN_CURRENT_CONTEXT = 501,\r\n /**\r\n Permissions denied by user\r\n */\r\n PERMISSION_DENIED = 1000,\r\n /**\r\n * Network issue\r\n */\r\n NETWORK_ERROR = 2000,\r\n /**\r\n * Underlying hardware doesn't support the capability\r\n */\r\n NO_HW_SUPPORT = 3000,\r\n /**\r\n * One or more arguments are invalid\r\n */\r\n INVALID_ARGUMENTS = 4000,\r\n /**\r\n * User is not authorized for this operation\r\n */\r\n UNAUTHORIZED_USER_OPERATION = 5000,\r\n /**\r\n * Could not complete the operation due to insufficient resources\r\n */\r\n INSUFFICIENT_RESOURCES = 6000,\r\n /**\r\n * Platform throttled the request because of API was invoked too frequently\r\n */\r\n THROTTLE = 7000,\r\n /**\r\n * User aborted the operation\r\n */\r\n USER_ABORT = 8000,\r\n /**\r\n * Could not complete the operation in the given time interval\r\n */\r\n OPERATION_TIMED_OUT = 8001,\r\n /**\r\n * Platform code is old and doesn't implement this API\r\n */\r\n OLD_PLATFORM = 9000,\r\n /**\r\n * The file specified was not found on the given location\r\n */\r\n FILE_NOT_FOUND = 404,\r\n /**\r\n * The return value is too big and has exceeded our size boundries\r\n */\r\n SIZE_EXCEEDED = 10000,\r\n}\r\n","export enum HostClientType {\r\n desktop = 'desktop',\r\n web = 'web',\r\n android = 'android',\r\n ios = 'ios',\r\n ipados = 'ipados',\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link teamsRoomsWindows} instead.\r\n */\r\n rigel = 'rigel',\r\n surfaceHub = 'surfaceHub',\r\n teamsRoomsWindows = 'teamsRoomsWindows',\r\n teamsRoomsAndroid = 'teamsRoomsAndroid',\r\n teamsPhones = 'teamsPhones',\r\n teamsDisplays = 'teamsDisplays',\r\n}\r\n\r\nexport enum HostName {\r\n office = 'Office',\r\n outlook = 'Outlook',\r\n orange = 'Orange',\r\n teams = 'Teams',\r\n}\r\n\r\n// Ensure these declarations stay in sync with the framework.\r\nexport enum FrameContexts {\r\n settings = 'settings',\r\n content = 'content',\r\n authentication = 'authentication',\r\n remove = 'remove',\r\n task = 'task',\r\n sidePanel = 'sidePanel',\r\n stage = 'stage',\r\n meetingStage = 'meetingStage',\r\n}\r\n\r\n/**\r\n * Indicates the team type, currently used to distinguish between different team\r\n * types in Office 365 for Education (team types 1, 2, 3, and 4).\r\n */\r\nexport enum TeamType {\r\n Standard = 0,\r\n Edu = 1,\r\n Class = 2,\r\n Plc = 3,\r\n Staff = 4,\r\n}\r\n\r\n/**\r\n * Indicates the various types of roles of a user in a team.\r\n */\r\nexport enum UserTeamRole {\r\n Admin = 0,\r\n User = 1,\r\n Guest = 2,\r\n}\r\n\r\n/**\r\n * Dialog module dimension enum\r\n */\r\nexport enum DialogDimension {\r\n Large = 'large',\r\n Medium = 'medium',\r\n Small = 'small',\r\n}\r\n\r\nimport { ErrorCode, SdkError } from './interfaces';\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link DialogDimension} instead.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nexport import TaskModuleDimension = DialogDimension;\r\n\r\n/**\r\n * The type of the channel with which the content is associated.\r\n */\r\nexport enum ChannelType {\r\n Regular = 'Regular',\r\n Private = 'Private',\r\n Shared = 'Shared',\r\n}\r\n\r\nexport const errorNotSupportedOnPlatform: SdkError = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };\r\n","import { FrameContexts } from '../public';\r\nexport class GlobalVars {\r\n public static initializeCalled = false;\r\n public static initializeCompleted = false;\r\n public static additionalValidOrigins: string[] = [];\r\n public static initializePromise: Promise;\r\n public static isFramelessWindow = false;\r\n public static frameContext: FrameContexts;\r\n public static hostClientType: string;\r\n public static clientSupportedSDKVersion: string;\r\n public static printCapabilityEnabled = false;\r\n}\r\n","import {\r\n Communication,\r\n sendMessageEventToChild,\r\n sendMessageToParent,\r\n sendMessageToParentAsync,\r\n waitForMessageQueue,\r\n} from '../internal/communication';\r\nimport { GlobalVars } from '../internal/globalVars';\r\nimport { registerHandler, removeHandler } from '../internal/handlers';\r\nimport { ensureInitialized } from '../internal/internalAPIs';\r\nimport { FrameContexts, HostClientType } from './constants';\r\n\r\n/**\r\n * Namespace to interact with the authentication-specific part of the SDK.\r\n *\r\n * This object is used for starting or completing authentication flows.\r\n *\r\n * @beta\r\n */\r\nexport namespace authentication {\r\n let authHandlers: { success: (string) => void; fail: (string) => void };\r\n let authWindowMonitor: number;\r\n\r\n export function initialize(): void {\r\n registerHandler('authentication.authenticate.success', handleSuccess, false);\r\n registerHandler('authentication.authenticate.failure', handleFailure, false);\r\n }\r\n\r\n let authParams: AuthenticateParameters;\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, this function has been deprecated in favor of a Promise-based pattern.\r\n * Registers the authentication Communication.handlers\r\n *\r\n * @param authenticateParameters - A set of values that configure the authentication pop-up.\r\n */\r\n export function registerAuthenticationHandlers(authenticateParameters: AuthenticateParameters): void {\r\n authParams = authenticateParameters;\r\n }\r\n\r\n /**\r\n * Initiates an authentication request, which opens a new window with the specified settings.\r\n *\r\n * @param authenticateParameters - The parameters for the authentication request. It is a required parameter since v2 upgrade\r\n *\r\n * @returns Promise that will be fulfilled with the result from the authentication pop-up if successful.\r\n *\r\n * @throws if the authentication request fails or is canceled by the user.\r\n *\r\n */\r\n export function authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise;\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\} instead.\r\n *\r\n * Initiates an authentication request, which opens a new window with the specified settings.\r\n *\r\n * @param authenticateParameters - The parameters for the authentication request.\r\n *\r\n */\r\n export function authenticate(authenticateParameters?: AuthenticateParameters): void;\r\n export function authenticate(authenticateParameters?: AuthenticateParameters): Promise {\r\n const isDifferentParamsInCall: boolean = authenticateParameters !== undefined;\r\n const authenticateParams: AuthenticateParameters = isDifferentParamsInCall ? authenticateParameters : authParams;\r\n if (!authenticateParams) {\r\n throw new Error('No parameters are provided for authentication');\r\n }\r\n ensureInitialized(\r\n FrameContexts.content,\r\n FrameContexts.sidePanel,\r\n FrameContexts.settings,\r\n FrameContexts.remove,\r\n FrameContexts.task,\r\n FrameContexts.stage,\r\n FrameContexts.meetingStage,\r\n );\r\n return authenticateHelper(authenticateParams)\r\n .then((value: string) => {\r\n try {\r\n if (authenticateParams && authenticateParams.successCallback) {\r\n authenticateParams.successCallback(value);\r\n return '';\r\n }\r\n return value;\r\n } finally {\r\n if (!isDifferentParamsInCall) {\r\n authParams = null;\r\n }\r\n }\r\n })\r\n .catch((err: Error) => {\r\n try {\r\n if (authenticateParams && authenticateParams.failureCallback) {\r\n authenticateParams.failureCallback(err.message);\r\n return '';\r\n }\r\n throw err;\r\n } finally {\r\n if (!isDifferentParamsInCall) {\r\n authParams = null;\r\n }\r\n }\r\n });\r\n }\r\n\r\n function authenticateHelper(authenticateParameters: AuthenticateParameters): Promise {\r\n return new Promise((resolve, reject) => {\r\n if (\r\n GlobalVars.hostClientType === HostClientType.desktop ||\r\n GlobalVars.hostClientType === HostClientType.android ||\r\n GlobalVars.hostClientType === HostClientType.ios ||\r\n GlobalVars.hostClientType === HostClientType.rigel ||\r\n GlobalVars.hostClientType === HostClientType.teamsRoomsWindows ||\r\n GlobalVars.hostClientType === HostClientType.teamsRoomsAndroid ||\r\n GlobalVars.hostClientType === HostClientType.teamsPhones ||\r\n GlobalVars.hostClientType === HostClientType.teamsDisplays\r\n ) {\r\n // Convert any relative URLs into absolute URLs before sending them over to the parent window.\r\n const link = document.createElement('a');\r\n link.href = authenticateParameters.url;\r\n // Ask the parent window to open an authentication window with the parameters provided by the caller.\r\n resolve(\r\n sendMessageToParentAsync<[boolean, string]>('authentication.authenticate', [\r\n link.href,\r\n authenticateParameters.width,\r\n authenticateParameters.height,\r\n authenticateParameters.isExternal,\r\n ]).then(([success, response]: [boolean, string]) => {\r\n if (success) {\r\n return response;\r\n } else {\r\n throw new Error(response);\r\n }\r\n }),\r\n );\r\n } else {\r\n // Open an authentication window with the parameters provided by the caller.\r\n authHandlers = {\r\n success: resolve,\r\n fail: reject,\r\n };\r\n openAuthenticationWindow(authenticateParameters);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Requests an Azure AD token to be issued on behalf of the app. The token is acquired from the cache\r\n * if it is not expired. Otherwise a request is sent to Azure AD to obtain a new token.\r\n *\r\n * @param authTokenRequest - An optional set of values that configure the token request.\r\n *\r\n * @returns Promise that will be fulfilled with the token if successful.\r\n */\r\n export function getAuthToken(authTokenRequest?: AuthTokenRequestParameters): Promise;\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link authentication.getAuthToken authentication.getAuthToken(authTokenRequest: AuthTokenRequestParameters): Promise\\} instead.\r\n *\r\n * Requests an Azure AD token to be issued on behalf of the app. The token is acquired from the cache\r\n * if it is not expired. Otherwise a request is sent to Azure AD to obtain a new token.\r\n *\r\n * @param authTokenRequest - An optional set of values that configure the token request.\r\n * It contains callbacks to call in case of success/failure\r\n */\r\n export function getAuthToken(authTokenRequest?: AuthTokenRequest): void;\r\n export function getAuthToken(authTokenRequest?: AuthTokenRequest): Promise {\r\n ensureInitialized();\r\n return getAuthTokenHelper(authTokenRequest)\r\n .then((value: string) => {\r\n if (authTokenRequest && authTokenRequest.successCallback) {\r\n authTokenRequest.successCallback(value);\r\n return '';\r\n }\r\n return value;\r\n })\r\n .catch((err: Error) => {\r\n if (authTokenRequest && authTokenRequest.failureCallback) {\r\n authTokenRequest.failureCallback(err.message);\r\n return '';\r\n }\r\n throw err;\r\n });\r\n }\r\n\r\n function getAuthTokenHelper(authTokenRequest?: AuthTokenRequest): Promise {\r\n return new Promise<[boolean, string]>(resolve => {\r\n resolve(\r\n sendMessageToParentAsync('authentication.getAuthToken', [\r\n authTokenRequest?.resources,\r\n authTokenRequest?.claims,\r\n authTokenRequest?.silent,\r\n ]),\r\n );\r\n }).then(([success, result]: [boolean, string]) => {\r\n if (success) {\r\n return result;\r\n } else {\r\n throw new Error(result);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs.\r\n * ------\r\n * Requests the decoded Azure AD user identity on behalf of the app.\r\n *\r\n * @returns Promise that resolves with the {@link UserProfile}.\r\n *\r\n * @internal\r\n */\r\n export function getUser(): Promise;\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link authentication.getUser authentication.getUser(): Promise\\} instead.\r\n *\r\n * @hidden\r\n * Hide from docs.\r\n * ------\r\n * Requests the decoded Azure AD user identity on behalf of the app.\r\n *\r\n * @param userRequest - It passes success/failure callbacks in the userRequest object(deprecated)\r\n * @internal\r\n */\r\n export function getUser(userRequest: UserRequest): void;\r\n export function getUser(userRequest?: UserRequest): Promise {\r\n ensureInitialized();\r\n return getUserHelper()\r\n .then((value: UserProfile) => {\r\n if (userRequest && userRequest.successCallback) {\r\n userRequest.successCallback(value);\r\n return null;\r\n }\r\n return value;\r\n })\r\n .catch((err: Error) => {\r\n if (userRequest && userRequest.failureCallback) {\r\n userRequest.failureCallback(err.message);\r\n return null;\r\n }\r\n throw err;\r\n });\r\n }\r\n\r\n function getUserHelper(): Promise {\r\n return new Promise<[boolean, UserProfile | string]>(resolve => {\r\n resolve(sendMessageToParentAsync('authentication.getUser'));\r\n }).then(([success, result]: [boolean, UserProfile | string]) => {\r\n if (success) {\r\n return result as UserProfile;\r\n } else {\r\n throw new Error(result as string);\r\n }\r\n });\r\n }\r\n\r\n function closeAuthenticationWindow(): void {\r\n // Stop monitoring the authentication window\r\n stopAuthenticationWindowMonitor();\r\n // Try to close the authentication window and clear all properties associated with it\r\n try {\r\n if (Communication.childWindow) {\r\n Communication.childWindow.close();\r\n }\r\n } finally {\r\n Communication.childWindow = null;\r\n Communication.childOrigin = null;\r\n }\r\n }\r\n\r\n function openAuthenticationWindow(authenticateParameters: AuthenticateParameters): void {\r\n // Close the previously opened window if we have one\r\n closeAuthenticationWindow();\r\n // Start with a sensible default size\r\n let width = authenticateParameters.width || 600;\r\n let height = authenticateParameters.height || 400;\r\n // Ensure that the new window is always smaller than our app's window so that it never fully covers up our app\r\n width = Math.min(width, Communication.currentWindow.outerWidth - 400);\r\n height = Math.min(height, Communication.currentWindow.outerHeight - 200);\r\n // Convert any relative URLs into absolute URLs before sending them over to the parent window\r\n const link = document.createElement('a');\r\n link.href = authenticateParameters.url.replace('{oauthRedirectMethod}', 'web');\r\n // We are running in the browser, so we need to center the new window ourselves\r\n let left: number =\r\n typeof Communication.currentWindow.screenLeft !== 'undefined'\r\n ? Communication.currentWindow.screenLeft\r\n : Communication.currentWindow.screenX;\r\n let top: number =\r\n typeof Communication.currentWindow.screenTop !== 'undefined'\r\n ? Communication.currentWindow.screenTop\r\n : Communication.currentWindow.screenY;\r\n left += Communication.currentWindow.outerWidth / 2 - width / 2;\r\n top += Communication.currentWindow.outerHeight / 2 - height / 2;\r\n // Open a child window with a desired set of standard browser features\r\n Communication.childWindow = Communication.currentWindow.open(\r\n link.href,\r\n '_blank',\r\n 'toolbar=no, location=yes, status=no, menubar=no, scrollbars=yes, top=' +\r\n top +\r\n ', left=' +\r\n left +\r\n ', width=' +\r\n width +\r\n ', height=' +\r\n height,\r\n );\r\n if (Communication.childWindow) {\r\n // Start monitoring the authentication window so that we can detect if it gets closed before the flow completes\r\n startAuthenticationWindowMonitor();\r\n } else {\r\n // If we failed to open the window, fail the authentication flow\r\n handleFailure('FailedToOpenWindow');\r\n }\r\n }\r\n\r\n function stopAuthenticationWindowMonitor(): void {\r\n if (authWindowMonitor) {\r\n clearInterval(authWindowMonitor);\r\n authWindowMonitor = 0;\r\n }\r\n removeHandler('initialize');\r\n removeHandler('navigateCrossDomain');\r\n }\r\n\r\n function startAuthenticationWindowMonitor(): void {\r\n // Stop the previous window monitor if one is running\r\n stopAuthenticationWindowMonitor();\r\n // Create an interval loop that\r\n // - Notifies the caller of failure if it detects that the authentication window is closed\r\n // - Keeps pinging the authentication window while it is open to re-establish\r\n // contact with any pages along the authentication flow that need to communicate\r\n // with us\r\n authWindowMonitor = Communication.currentWindow.setInterval(() => {\r\n if (!Communication.childWindow || Communication.childWindow.closed) {\r\n handleFailure('CancelledByUser');\r\n } else {\r\n const savedChildOrigin = Communication.childOrigin;\r\n try {\r\n Communication.childOrigin = '*';\r\n sendMessageEventToChild('ping');\r\n } finally {\r\n Communication.childOrigin = savedChildOrigin;\r\n }\r\n }\r\n }, 100);\r\n // Set up an initialize-message handler that gives the authentication window its frame context\r\n registerHandler('initialize', () => {\r\n return [FrameContexts.authentication, GlobalVars.hostClientType];\r\n });\r\n // Set up a navigateCrossDomain message handler that blocks cross-domain re-navigation attempts\r\n // in the authentication window. We could at some point choose to implement this method via a call to\r\n // authenticationWindow.location.href = url; however, we would first need to figure out how to\r\n // validate the URL against the tab's list of valid domains.\r\n registerHandler('navigateCrossDomain', () => {\r\n return false;\r\n });\r\n }\r\n\r\n /**\r\n * Notifies the frame that initiated this authentication request that the request was successful.\r\n *\r\n * @remarks\r\n * This function is usable only on the authentication window.\r\n * This call causes the authentication window to be closed.\r\n *\r\n * @param result - Specifies a result for the authentication. If specified, the frame that initiated the authentication pop-up receives this value in its callback.\r\n * @param callbackUrl - Specifies the url to redirect back to if the client is Win32 Outlook.\r\n */\r\n export function notifySuccess(result?: string, callbackUrl?: string): void {\r\n redirectIfWin32Outlook(callbackUrl, 'result', result);\r\n ensureInitialized(FrameContexts.authentication);\r\n sendMessageToParent('authentication.authenticate.success', [result]);\r\n // Wait for the message to be sent before closing the window\r\n waitForMessageQueue(Communication.parentWindow, () => setTimeout(() => Communication.currentWindow.close(), 200));\r\n }\r\n\r\n /**\r\n * Notifies the frame that initiated this authentication request that the request failed.\r\n *\r\n * @remarks\r\n * This function is usable only on the authentication window.\r\n * This call causes the authentication window to be closed.\r\n *\r\n * @param result - Specifies a result for the authentication. If specified, the frame that initiated the authentication pop-up receives this value in its callback.\r\n * @param callbackUrl - Specifies the url to redirect back to if the client is Win32 Outlook.\r\n */\r\n export function notifyFailure(reason?: string, callbackUrl?: string): void {\r\n redirectIfWin32Outlook(callbackUrl, 'reason', reason);\r\n ensureInitialized(FrameContexts.authentication);\r\n sendMessageToParent('authentication.authenticate.failure', [reason]);\r\n // Wait for the message to be sent before closing the window\r\n waitForMessageQueue(Communication.parentWindow, () => setTimeout(() => Communication.currentWindow.close(), 200));\r\n }\r\n\r\n function handleSuccess(result?: string): void {\r\n try {\r\n if (authHandlers) {\r\n authHandlers.success(result);\r\n }\r\n } finally {\r\n authHandlers = null;\r\n closeAuthenticationWindow();\r\n }\r\n }\r\n\r\n function handleFailure(reason?: string): void {\r\n try {\r\n if (authHandlers) {\r\n authHandlers.fail(new Error(reason));\r\n }\r\n } finally {\r\n authHandlers = null;\r\n closeAuthenticationWindow();\r\n }\r\n }\r\n\r\n /**\r\n * Validates that the callbackUrl param is a valid connector url, appends the result/reason and authSuccess/authFailure as URL fragments and redirects the window\r\n * @param callbackUrl - the connectors url to redirect to\r\n * @param key - \"result\" in case of success and \"reason\" in case of failure\r\n * @param value - the value of the passed result/reason parameter\r\n */\r\n function redirectIfWin32Outlook(callbackUrl?: string, key?: string, value?: string): void {\r\n if (callbackUrl) {\r\n const link = document.createElement('a');\r\n link.href = decodeURIComponent(callbackUrl);\r\n if (\r\n link.host &&\r\n link.host !== window.location.host &&\r\n link.host === 'outlook.office.com' &&\r\n link.search.indexOf('client_type=Win32_Outlook') > -1\r\n ) {\r\n if (key && key === 'result') {\r\n if (value) {\r\n link.href = updateUrlParameter(link.href, 'result', value);\r\n }\r\n Communication.currentWindow.location.assign(updateUrlParameter(link.href, 'authSuccess', ''));\r\n }\r\n if (key && key === 'reason') {\r\n if (value) {\r\n link.href = updateUrlParameter(link.href, 'reason', value);\r\n }\r\n Communication.currentWindow.location.assign(updateUrlParameter(link.href, 'authFailure', ''));\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Appends either result or reason as a fragment to the 'callbackUrl'\r\n * @param uri - the url to modify\r\n * @param key - the fragment key\r\n * @param value - the fragment value\r\n */\r\n function updateUrlParameter(uri: string, key: string, value: string): string {\r\n const i = uri.indexOf('#');\r\n let hash = i === -1 ? '#' : uri.substr(i);\r\n hash = hash + '&' + key + (value !== '' ? '=' + value : '');\r\n uri = i === -1 ? uri : uri.substr(0, i);\r\n return uri + hash;\r\n }\r\n\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, this interface has been deprecated in favor of a Promise-based pattern.\r\n *-------------------------\r\n * Used in {@link AuthenticateParameters} and {@link AuthTokenRequest}\r\n */\r\n export interface LegacyCallBacks {\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, this property has been deprecated in favor of a Promise-based pattern.\r\n * A function that is called if the request succeeds.\r\n */\r\n successCallback?: (result: string) => void;\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, this property has been deprecated in favor of a Promise-based pattern.\r\n * A function that is called if the request fails, with the reason for the failure.\r\n */\r\n failureCallback?: (reason: string) => void;\r\n }\r\n\r\n /**\r\n * Describes the authentication pop-up parameters\r\n */\r\n export interface AuthenticatePopUpParameters {\r\n /**\r\n * The URL for the authentication pop-up.\r\n */\r\n url: string;\r\n /**\r\n * The preferred width for the pop-up. This value can be ignored if outside the acceptable bounds.\r\n */\r\n width?: number;\r\n /**\r\n * The preferred height for the pop-up. This value can be ignored if outside the acceptable bounds.\r\n */\r\n height?: number;\r\n /**\r\n * The flag which indicates whether the auth page should be opened in an external browser. This flag has no effect on the web client.\r\n */\r\n isExternal?: boolean;\r\n }\r\n\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link AuthenticatePopUpParameters} instead.\r\n */\r\n export type AuthenticateParameters = AuthenticatePopUpParameters & LegacyCallBacks;\r\n\r\n /**\r\n * Describes authentication token request parameters\r\n */\r\n export interface AuthTokenRequestParameters {\r\n /**\r\n * An optional list of resource for which to acquire the access token; only used for full trust apps.\r\n */\r\n resources?: string[];\r\n /**\r\n * An optional list of claims which to pass to AAD when requesting the access token.\r\n */\r\n claims?: string[];\r\n /**\r\n * An optional flag indicating whether to attempt the token acquisition silently or allow a prompt to be shown.\r\n */\r\n silent?: boolean;\r\n }\r\n\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link AuthTokenRequestParameters} instead.\r\n */\r\n export type AuthTokenRequest = AuthTokenRequestParameters & LegacyCallBacks;\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs.\r\n * ------\r\n *\r\n * @internal\r\n */\r\n export interface UserProfile {\r\n /**\r\n * @hidden\r\n * The intended recipient of the token. The application that receives the token must verify that the audience\r\n * value is correct and reject any tokens intended for a different audience.\r\n */\r\n aud: string;\r\n /**\r\n * @hidden\r\n * Identifies how the subject of the token was authenticated.\r\n */\r\n amr: string[];\r\n /**\r\n * @hidden\r\n * Stores the time at which the token was issued. It is often used to measure token freshness.\r\n */\r\n iat: number;\r\n /**\r\n * @hidden\r\n * Identifies the security token service (STS) that constructs and returns the token. In the tokens that Azure AD\r\n * returns, the issuer is sts.windows.net. The GUID in the issuer claim value is the tenant ID of the Azure AD\r\n * directory. The tenant ID is an immutable and reliable identifier of the directory.\r\n */\r\n iss: string;\r\n /**\r\n * @hidden\r\n * Provides the last name, surname, or family name of the user as defined in the Azure AD user object.\r\n */\r\n family_name: string;\r\n /**\r\n * @hidden\r\n * Provides the first or \"given\" name of the user, as set on the Azure AD user object.\r\n */\r\n given_name: string;\r\n /**\r\n * @hidden\r\n * Provides a human-readable value that identifies the subject of the token. This value is not guaranteed to\r\n * be unique within a tenant and is designed to be used only for display purposes.\r\n */\r\n unique_name: string;\r\n /**\r\n * @hidden\r\n * Contains a unique identifier of an object in Azure AD. This value is immutable and cannot be reassigned or\r\n * reused. Use the object ID to identify an object in queries to Azure AD.\r\n */\r\n oid: string;\r\n /**\r\n * @hidden\r\n * Identifies the principal about which the token asserts information, such as the user of an application.\r\n * This value is immutable and cannot be reassigned or reused, so it can be used to perform authorization\r\n * checks safely. Because the subject is always present in the tokens the Azure AD issues, we recommended\r\n * using this value in a general-purpose authorization system.\r\n */\r\n sub: string;\r\n /**\r\n * @hidden\r\n * An immutable, non-reusable identifier that identifies the directory tenant that issued the token. You can\r\n * use this value to access tenant-specific directory resources in a multitenant application. For example,\r\n * you can use this value to identify the tenant in a call to the Graph API.\r\n */\r\n tid: string;\r\n /**\r\n * @hidden\r\n * Defines the end of the time interval within which a token is valid. The service that validates the token\r\n * should verify that the current date is within the token lifetime; otherwise it should reject the token. The\r\n * service might allow for up to five minutes beyond the token lifetime to account for any differences in clock\r\n * time (\"time skew\") between Azure AD and the service.\r\n */\r\n exp: number;\r\n /**\r\n * @hidden\r\n * Defines the start of the time interval within which a token is valid. The service that validates the token\r\n * should verify that the current date is within the token lifetime; otherwise it should reject the token. The\r\n * service might allow for up to five minutes beyond the token lifetime to account for any differences in clock\r\n * time (\"time skew\") between Azure AD and the service.\r\n */\r\n nbf: number;\r\n /**\r\n * @hidden\r\n * Stores the user name of the user principal.\r\n */\r\n upn: string;\r\n /**\r\n * @hidden\r\n * Stores the version number of the token.\r\n */\r\n ver: string;\r\n }\r\n\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, this interface has been deprecated in favor of a Promise-based pattern.\r\n * @hidden\r\n * Hide from docs.\r\n * ------\r\n * Describes the UserRequest. Success callback describes how a successful request is handled.\r\n * Failure callback describes how a failed request is handled.\r\n * @internal\r\n */\r\n export interface UserRequest {\r\n /**\r\n * A function that is called if the token request succeeds, with the resulting token.\r\n */\r\n successCallback?: (user: UserProfile) => void;\r\n /**\r\n * A function that is called if the token request fails, with the reason for the failure.\r\n */\r\n failureCallback?: (reason: string) => void;\r\n }\r\n}\r\n","/* eslint-disable @typescript-eslint/ban-types */\r\n/* eslint-disable @typescript-eslint/no-unused-vars */\r\nimport * as uuid from 'uuid';\r\n\r\nimport { GlobalVars } from '../internal/globalVars';\r\nimport { SdkError } from '../public/interfaces';\r\nimport { pages } from '../public/pages';\r\nimport { validOrigins } from './constants';\r\n\r\n/**\r\n * @param pattern - reference pattern\r\n * @param host - candidate string\r\n * @returns returns true if host matches pre-know valid pattern\r\n *\r\n * @example\r\n * validateHostAgainstPattern('*.teams.microsoft.com', 'subdomain.teams.microsoft.com') returns true\r\n * validateHostAgainstPattern('teams.microsoft.com', 'team.microsoft.com') returns false\r\n *\r\n * @internal\r\n */\r\nfunction validateHostAgainstPattern(pattern: string, host: string): boolean {\r\n if (pattern.substring(0, 2) === '*.') {\r\n const suffix = pattern.substring(1);\r\n if (\r\n host.length > suffix.length &&\r\n host.split('.').length === suffix.split('.').length &&\r\n host.substring(host.length - suffix.length) === suffix\r\n ) {\r\n return true;\r\n }\r\n } else if (pattern === host) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**@internal */\r\nexport function validateOrigin(messageOrigin: URL): boolean {\r\n // Check whether the url is in the pre-known allowlist or supplied by user\r\n if (messageOrigin.protocol !== 'https:') {\r\n return false;\r\n }\r\n const messageOriginHost = messageOrigin.host;\r\n\r\n if (validOrigins.some(pattern => validateHostAgainstPattern(pattern, messageOriginHost))) {\r\n return true;\r\n }\r\n\r\n for (const domainOrPattern of GlobalVars.additionalValidOrigins) {\r\n const pattern = domainOrPattern.substring(0, 8) === 'https://' ? domainOrPattern.substring(8) : domainOrPattern;\r\n if (validateHostAgainstPattern(pattern, messageOriginHost)) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/**@internal */\r\nexport function getGenericOnCompleteHandler(errorMessage?: string): (success: boolean, reason?: string) => void {\r\n return (success: boolean, reason: string): void => {\r\n if (!success) {\r\n throw new Error(errorMessage ? errorMessage : reason);\r\n }\r\n };\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Compares SDK versions.\r\n *\r\n * @param v1 - first version\r\n * @param v2 - second version\r\n * @returns NaN in case inputs are not in right format\r\n * -1 if v1 < v2\r\n * 1 if v1 > v2\r\n * 0 otherwise\r\n * @example\r\n * compareSDKVersions('1.2', '1.2.0') returns 0\r\n * compareSDKVersions('1.2a', '1.2b') returns NaN\r\n * compareSDKVersions('1.2', '1.3') returns -1\r\n * compareSDKVersions('2.0', '1.3.2') returns 1\r\n * compareSDKVersions('2.0', 2.0) returns NaN\r\n *\r\n * @internal\r\n */\r\nexport function compareSDKVersions(v1: string, v2: string): number {\r\n if (typeof v1 !== 'string' || typeof v2 !== 'string') {\r\n return NaN;\r\n }\r\n\r\n const v1parts = v1.split('.');\r\n const v2parts = v2.split('.');\r\n\r\n function isValidPart(x: string): boolean {\r\n // input has to have one or more digits\r\n // For ex - returns true for '11', false for '1a1', false for 'a', false for '2b'\r\n return /^\\d+$/.test(x);\r\n }\r\n\r\n if (!v1parts.every(isValidPart) || !v2parts.every(isValidPart)) {\r\n return NaN;\r\n }\r\n\r\n // Make length of both parts equal\r\n while (v1parts.length < v2parts.length) {\r\n v1parts.push('0');\r\n }\r\n while (v2parts.length < v1parts.length) {\r\n v2parts.push('0');\r\n }\r\n\r\n for (let i = 0; i < v1parts.length; ++i) {\r\n if (Number(v1parts[i]) == Number(v2parts[i])) {\r\n continue;\r\n } else if (Number(v1parts[i]) > Number(v2parts[i])) {\r\n return 1;\r\n } else {\r\n return -1;\r\n }\r\n }\r\n return 0;\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Generates a GUID\r\n *\r\n * @internal\r\n */\r\nexport function generateGUID(): string {\r\n return uuid.v4();\r\n}\r\n\r\nexport function deepFreeze(obj: T): T {\r\n Object.keys(obj).forEach(prop => {\r\n if (typeof obj[prop] === 'object') {\r\n deepFreeze(obj[prop]);\r\n }\r\n });\r\n return Object.freeze(obj);\r\n}\r\n\r\n/**\r\n * @hidden\r\n * The following type definitions will be used in the\r\n * utility functions below, which help in transforming the\r\n * promises to support callbacks for backward compatibility\r\n *\r\n * @internal\r\n */\r\nexport type ErrorResultCallback = (err?: SdkError, result?: T) => void;\r\nexport type ErrorResultNullCallback = (err: SdkError | null, result: T | null) => void;\r\nexport type ErrorBooleanResultCallback = (err?: SdkError, result?: boolean) => void;\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nexport type InputFunction = (...args: any[]) => Promise;\r\nexport type ResultCallback = (result?: T) => void;\r\nexport type SdkErrorCallback = ResultCallback;\r\n\r\n/**\r\n * This utility function is used when the result of the promise is same as the result in the callback.\r\n * @param funcHelper\r\n * @param callback\r\n * @param args\r\n * @returns\r\n *\r\n * @internal\r\n */\r\nexport function callCallbackWithErrorOrResultFromPromiseAndReturnPromise(\r\n funcHelper: InputFunction,\r\n callback?: ErrorResultCallback,\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n ...args: any[]\r\n): Promise {\r\n const p = funcHelper(...args);\r\n p.then((result: T) => {\r\n if (callback) {\r\n callback(undefined, result);\r\n }\r\n }).catch((e: SdkError) => {\r\n if (callback) {\r\n callback(e);\r\n }\r\n });\r\n return p;\r\n}\r\n\r\n/**\r\n * This utility function is used when the return type of the promise is usually void and\r\n * the result in the callback is a boolean type (true for success and false for error)\r\n * @param funcHelper\r\n * @param callback\r\n * @param args\r\n * @returns\r\n * @internal\r\n */\r\nexport function callCallbackWithErrorOrBooleanFromPromiseAndReturnPromise(\r\n funcHelper: InputFunction,\r\n callback?: ErrorBooleanResultCallback,\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n ...args: any[]\r\n): Promise {\r\n const p = funcHelper(...args);\r\n p.then(() => {\r\n if (callback) {\r\n callback(undefined, true);\r\n }\r\n }).catch((e: SdkError) => {\r\n if (callback) {\r\n callback(e, false);\r\n }\r\n });\r\n return p;\r\n}\r\n\r\n/**\r\n * This utility function is called when the callback has only Error/SdkError as the primary argument.\r\n * @param funcHelper\r\n * @param callback\r\n * @param args\r\n * @returns\r\n * @internal\r\n */\r\nexport function callCallbackWithSdkErrorFromPromiseAndReturnPromise(\r\n funcHelper: InputFunction,\r\n callback?: SdkErrorCallback,\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n ...args: any[]\r\n): Promise {\r\n const p = funcHelper(...args);\r\n p.then(() => {\r\n if (callback) {\r\n callback(null);\r\n }\r\n }).catch((e: SdkError) => {\r\n if (callback) {\r\n callback(e);\r\n }\r\n });\r\n return p;\r\n}\r\n\r\n/**\r\n * This utility function is used when the result of the promise is same as the result in the callback.\r\n * @param funcHelper\r\n * @param callback\r\n * @param args\r\n * @returns\r\n *\r\n * @internal\r\n */\r\nexport function callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise(\r\n funcHelper: InputFunction,\r\n callback?: ErrorResultNullCallback,\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n ...args: any[]\r\n): Promise {\r\n const p = funcHelper(...args);\r\n p.then((result: T) => {\r\n if (callback) {\r\n callback(null, result);\r\n }\r\n }).catch((e: SdkError) => {\r\n if (callback) {\r\n callback(e, null);\r\n }\r\n });\r\n return p;\r\n}\r\n\r\n/**\r\n * A helper function to add a timeout to an asynchronous operation.\r\n *\r\n * @param action Action to wrap the timeout around\r\n * @param timeoutInMs Timeout period in milliseconds\r\n * @param timeoutError Error to reject the promise with if timeout elapses before the action completed\r\n * @returns A promise which resolves to the result of provided action or rejects with a provided timeout error\r\n * if the initial action didn't complete within provided timeout.\r\n *\r\n * @internal\r\n */\r\nexport function runWithTimeout(\r\n action: () => Promise,\r\n timeoutInMs: number,\r\n timeoutError: TError,\r\n): Promise {\r\n return new Promise((resolve, reject) => {\r\n const timeoutHandle = setTimeout(reject, timeoutInMs, timeoutError);\r\n action()\r\n .then(result => {\r\n clearTimeout(timeoutHandle);\r\n resolve(result);\r\n })\r\n .catch(error => {\r\n clearTimeout(timeoutHandle);\r\n reject(error);\r\n });\r\n });\r\n}\r\n\r\nexport function createTeamsAppLink(params: pages.NavigateToAppParams): string {\r\n const url = new URL(\r\n 'https://teams.microsoft.com/l/entity/' +\r\n encodeURIComponent(params.appId) +\r\n '/' +\r\n encodeURIComponent(params.pageId),\r\n );\r\n\r\n if (params.webUrl) {\r\n url.searchParams.append('webUrl', params.webUrl);\r\n }\r\n if (params.channelId || params.subPageId) {\r\n url.searchParams.append('context', JSON.stringify({ channelId: params.channelId, subEntityId: params.subPageId }));\r\n }\r\n return url.toString();\r\n}\r\n","import { HostClientType } from '../public/constants';\r\nimport { ErrorCode, SdkError } from '../public/interfaces';\r\nimport { defaultSDKVersionForCompatCheck, userOriginUrlValidationRegExp } from './constants';\r\nimport { GlobalVars } from './globalVars';\r\nimport { compareSDKVersions } from './utils';\r\n\r\n/** @internal */\r\nexport function ensureInitialized(...expectedFrameContexts: string[]): void {\r\n if (!GlobalVars.initializeCalled) {\r\n throw new Error('The library has not yet been initialized');\r\n }\r\n\r\n if (GlobalVars.frameContext && expectedFrameContexts && expectedFrameContexts.length > 0) {\r\n let found = false;\r\n for (let i = 0; i < expectedFrameContexts.length; i++) {\r\n if (expectedFrameContexts[i] === GlobalVars.frameContext) {\r\n found = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!found) {\r\n throw new Error(\r\n `This call is only allowed in following contexts: ${JSON.stringify(expectedFrameContexts)}. ` +\r\n `Current context: \"${GlobalVars.frameContext}\".`,\r\n );\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Checks whether the platform has knowledge of this API by doing a comparison\r\n * on API required version and platform supported version of the SDK\r\n *\r\n * @param requiredVersion - SDK version required by the API\r\n *\r\n * @internal\r\n */\r\nexport function isCurrentSDKVersionAtLeast(requiredVersion: string = defaultSDKVersionForCompatCheck): boolean {\r\n const value = compareSDKVersions(GlobalVars.clientSupportedSDKVersion, requiredVersion);\r\n if (isNaN(value)) {\r\n return false;\r\n }\r\n return value >= 0;\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Helper function to identify if host client is either android or ios\r\n *\r\n * @internal\r\n */\r\nexport function isHostClientMobile(): boolean {\r\n return GlobalVars.hostClientType == HostClientType.android || GlobalVars.hostClientType == HostClientType.ios;\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Helper function which indicates if current API is supported on mobile or not.\r\n * @throws SdkError if host client is not android/ios or if the requiredVersion is not\r\n * supported by platform or not. Null is returned in case of success.\r\n *\r\n * @internal\r\n */\r\nexport function throwExceptionIfMobileApiIsNotSupported(\r\n requiredVersion: string = defaultSDKVersionForCompatCheck,\r\n): void {\r\n if (!isHostClientMobile()) {\r\n const notSupportedError: SdkError = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };\r\n throw notSupportedError;\r\n } else if (!isCurrentSDKVersionAtLeast(requiredVersion)) {\r\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\r\n throw oldPlatformError;\r\n }\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Processes the valid origins specifuied by the user, de-duplicates and converts them into a regexp\r\n * which is used later for message source/origin validation\r\n *\r\n * @internal\r\n */\r\nexport function processAdditionalValidOrigins(validMessageOrigins: string[]): void {\r\n let combinedOriginUrls = GlobalVars.additionalValidOrigins.concat(\r\n validMessageOrigins.filter((_origin: string) => {\r\n return typeof _origin === 'string' && userOriginUrlValidationRegExp.test(_origin);\r\n }),\r\n );\r\n const dedupUrls: { [url: string]: boolean } = {};\r\n combinedOriginUrls = combinedOriginUrls.filter(_originUrl => {\r\n if (dedupUrls[_originUrl]) {\r\n return false;\r\n }\r\n dedupUrls[_originUrl] = true;\r\n return true;\r\n });\r\n GlobalVars.additionalValidOrigins = combinedOriginUrls;\r\n}\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\n\r\nimport { Communication, sendMessageEventToChild, sendMessageToParent } from '../internal/communication';\r\nimport { registerHandler } from '../internal/handlers';\r\nimport { ensureInitialized } from '../internal/internalAPIs';\r\nimport { getGenericOnCompleteHandler } from '../internal/utils';\r\nimport { FrameContexts } from '../public/constants';\r\nimport { FilePreviewParameters, UserSettingTypes } from './interfaces';\r\n\r\n/**\r\n * @internal\r\n */\r\nexport function initializePrivateApis(): void {\r\n // To maintain backwards compatability, this function cannot be deleted as it is callable\r\n}\r\n/**\r\n * @hidden\r\n * Hide from docs.\r\n * ------\r\n * Upload a custom App manifest directly to both team and personal scopes.\r\n * This method works just for the first party Apps.\r\n *\r\n * @internal\r\n */\r\nexport function uploadCustomApp(manifestBlob: Blob, onComplete?: (status: boolean, reason?: string) => void): void {\r\n ensureInitialized();\r\n\r\n sendMessageToParent('uploadCustomApp', [manifestBlob], onComplete ? onComplete : getGenericOnCompleteHandler());\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Internal use only\r\n * Sends a custom action MessageRequest to host or parent window\r\n *\r\n * @param actionName - Specifies name of the custom action to be sent\r\n * @param args - Specifies additional arguments passed to the action\r\n * @param callback - Optionally specify a callback to receive response parameters from the parent\r\n * @returns id of sent message\r\n *\r\n * @internal\r\n */\r\nexport function sendCustomMessage(\r\n actionName: string,\r\n // tslint:disable-next-line:no-any\r\n args?: any[],\r\n // tslint:disable-next-line:no-any\r\n callback?: (...args: any[]) => void,\r\n): void {\r\n ensureInitialized();\r\n\r\n sendMessageToParent(actionName, args, callback);\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Internal use only\r\n * Sends a custom action MessageEvent to a child iframe/window, only if you are not using auth popup.\r\n * Otherwise it will go to the auth popup (which becomes the child)\r\n *\r\n * @param actionName - Specifies name of the custom action to be sent\r\n * @param args - Specifies additional arguments passed to the action\r\n * @returns id of sent message\r\n *\r\n * @internal\r\n */\r\nexport function sendCustomEvent(\r\n actionName: string,\r\n // tslint:disable-next-line:no-any\r\n args?: any[],\r\n): void {\r\n ensureInitialized();\r\n\r\n //validate childWindow\r\n if (!Communication.childWindow) {\r\n throw new Error('The child window has not yet been initialized or is not present');\r\n }\r\n sendMessageEventToChild(actionName, args);\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Internal use only\r\n * Adds a handler for an action sent by a child window or parent window\r\n *\r\n * @param actionName - Specifies name of the action message to handle\r\n * @param customHandler - The callback to invoke when the action message is received. The return value is sent to the child\r\n *\r\n * @internal\r\n */\r\nexport function registerCustomHandler(\r\n actionName: string,\r\n customHandler: (\r\n // tslint:disable-next-line:no-any\r\n ...args: any[]\r\n ) => any[],\r\n): void {\r\n ensureInitialized();\r\n registerHandler(actionName, (...args: any[]) => {\r\n return customHandler.apply(this, args);\r\n });\r\n}\r\n\r\n/**\r\n * @hidden\r\n * register a handler to be called when a user setting changes. The changed setting type & value is provided in the callback.\r\n *\r\n * @param settingTypes - List of user setting changes to subscribe\r\n * @param handler - When a subscribed setting is updated this handler is called\r\n *\r\n * @internal\r\n */\r\nexport function registerUserSettingsChangeHandler(\r\n settingTypes: UserSettingTypes[],\r\n handler: (settingType: UserSettingTypes, value: any) => void,\r\n): void {\r\n ensureInitialized();\r\n\r\n registerHandler('userSettingsChange', handler, true, [settingTypes]);\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Hide from docs.\r\n * ------\r\n * Opens a client-friendly preview of the specified file.\r\n *\r\n * @param file - The file to preview.\r\n */\r\nexport function openFilePreview(filePreviewParameters: FilePreviewParameters): void {\r\n ensureInitialized(FrameContexts.content, FrameContexts.task);\r\n\r\n const params = [\r\n filePreviewParameters.entityId,\r\n filePreviewParameters.title,\r\n filePreviewParameters.description,\r\n filePreviewParameters.type,\r\n filePreviewParameters.objectUrl,\r\n filePreviewParameters.downloadUrl,\r\n filePreviewParameters.webPreviewUrl,\r\n filePreviewParameters.webEditUrl,\r\n filePreviewParameters.baseUrl,\r\n filePreviewParameters.editFile,\r\n filePreviewParameters.subEntityId,\r\n filePreviewParameters.viewerAction,\r\n filePreviewParameters.fileOpenPreference,\r\n filePreviewParameters.conversationId,\r\n ];\r\n\r\n sendMessageToParent('openFilePreview', params);\r\n}\r\n","/* eslint-disable @typescript-eslint/ban-types */\r\n\r\nimport { GlobalVars } from '../internal/globalVars';\r\nimport { compareSDKVersions, deepFreeze } from '../internal/utils';\r\nimport { HostClientType } from './constants';\r\nexport interface IRuntime {\r\n readonly apiVersion: number;\r\n readonly isLegacyTeams?: boolean;\r\n readonly supports: {\r\n readonly appInstallDialog?: {};\r\n readonly appEntity?: {};\r\n readonly calendar?: {};\r\n readonly call?: {};\r\n readonly chat?: {};\r\n readonly conversations?: {};\r\n readonly dialog?: {\r\n readonly bot?: {};\r\n readonly update?: {};\r\n };\r\n readonly location?: {};\r\n readonly logs?: {};\r\n readonly mail?: {};\r\n readonly meetingRoom?: {};\r\n readonly menus?: {};\r\n readonly monetization?: {};\r\n readonly notifications?: {};\r\n readonly pages?: {\r\n readonly appButton?: {};\r\n readonly tabs?: {};\r\n readonly config?: {};\r\n readonly backStack?: {};\r\n readonly fullTrust?: {};\r\n };\r\n readonly people?: {};\r\n readonly remoteCamera?: {};\r\n readonly sharing?: {};\r\n readonly teams?: {\r\n readonly fullTrust?: {\r\n readonly joinedTeams?: {};\r\n };\r\n };\r\n readonly teamsCore?: {};\r\n readonly video?: {};\r\n };\r\n}\r\n\r\nexport let runtime: IRuntime = {\r\n apiVersion: 1,\r\n supports: {\r\n appInstallDialog: undefined,\r\n calendar: undefined,\r\n call: undefined,\r\n chat: undefined,\r\n conversations: undefined,\r\n dialog: {\r\n bot: undefined,\r\n update: undefined,\r\n },\r\n location: undefined,\r\n logs: undefined,\r\n mail: undefined,\r\n meetingRoom: undefined,\r\n menus: undefined,\r\n monetization: undefined,\r\n notifications: undefined,\r\n pages: {\r\n appButton: undefined,\r\n tabs: undefined,\r\n config: undefined,\r\n backStack: undefined,\r\n fullTrust: undefined,\r\n },\r\n people: undefined,\r\n remoteCamera: undefined,\r\n sharing: undefined,\r\n teams: {\r\n fullTrust: {\r\n joinedTeams: undefined,\r\n },\r\n },\r\n teamsCore: undefined,\r\n video: undefined,\r\n },\r\n};\r\n\r\nexport const teamsRuntimeConfig: IRuntime = {\r\n apiVersion: 1,\r\n isLegacyTeams: true,\r\n supports: {\r\n appInstallDialog: {},\r\n appEntity: {},\r\n call: {},\r\n chat: {},\r\n conversations: {},\r\n dialog: {\r\n bot: {},\r\n update: {},\r\n },\r\n logs: {},\r\n meetingRoom: {},\r\n menus: {},\r\n monetization: {},\r\n notifications: {},\r\n pages: {\r\n appButton: {},\r\n tabs: {},\r\n config: {},\r\n backStack: {},\r\n fullTrust: {},\r\n },\r\n remoteCamera: {},\r\n sharing: {},\r\n teams: {\r\n fullTrust: {},\r\n },\r\n teamsCore: {},\r\n video: {},\r\n },\r\n};\r\n\r\ninterface ICapabilityReqs {\r\n readonly capability: object;\r\n readonly hostClientTypes: Array;\r\n}\r\n\r\nexport const v1HostClientTypes = [\r\n HostClientType.desktop,\r\n HostClientType.web,\r\n HostClientType.android,\r\n HostClientType.ios,\r\n HostClientType.rigel,\r\n HostClientType.surfaceHub,\r\n HostClientType.teamsRoomsWindows,\r\n HostClientType.teamsRoomsAndroid,\r\n HostClientType.teamsPhones,\r\n HostClientType.teamsDisplays,\r\n];\r\n\r\nexport const versionConstants: Record> = {\r\n '1.9.0': [\r\n {\r\n capability: { location: {} },\r\n hostClientTypes: v1HostClientTypes,\r\n },\r\n ],\r\n '2.0.0': [\r\n {\r\n capability: { people: {} },\r\n hostClientTypes: v1HostClientTypes,\r\n },\r\n ],\r\n '2.0.1': [\r\n {\r\n capability: { teams: { fullTrust: { joinedTeams: {} } } },\r\n hostClientTypes: [\r\n HostClientType.android,\r\n HostClientType.teamsRoomsAndroid,\r\n HostClientType.teamsPhones,\r\n HostClientType.teamsDisplays,\r\n ],\r\n },\r\n ],\r\n};\r\n\r\n/**\r\n * @internal\r\n *\r\n * Generates and returns a runtime configuration for host clients which are not on the latest host SDK version\r\n * and do not provide their own runtime config. Their supported capabilities are based on the highest\r\n * client SDK version that they can support.\r\n *\r\n * @param highestSupportedVersion - The highest client SDK version that the host client can support.\r\n * @returns runtime which describes the APIs supported by the legacy host client.\r\n */\r\nexport function generateBackCompatRuntimeConfig(highestSupportedVersion: string): IRuntime {\r\n let newSupports = { ...teamsRuntimeConfig.supports };\r\n\r\n Object.keys(versionConstants).forEach(versionNumber => {\r\n if (compareSDKVersions(highestSupportedVersion, versionNumber) >= 0) {\r\n versionConstants[versionNumber].forEach(capabilityReqs => {\r\n if (capabilityReqs.hostClientTypes.includes(GlobalVars.hostClientType)) {\r\n newSupports = {\r\n ...newSupports,\r\n ...capabilityReqs.capability,\r\n };\r\n }\r\n });\r\n }\r\n });\r\n\r\n const backCompatRuntimeConfig: IRuntime = {\r\n apiVersion: 1,\r\n isLegacyTeams: true,\r\n supports: newSupports,\r\n };\r\n return backCompatRuntimeConfig;\r\n}\r\n\r\nexport function applyRuntimeConfig(runtimeConfig: IRuntime): void {\r\n runtime = deepFreeze(runtimeConfig);\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Hide from docs.\r\n * ------\r\n * Constant used to set minimum runtime configuration\r\n * while un-initializing an app in unit test case.\r\n *\r\n * @internal\r\n */\r\nexport const _minRuntimeConfigToUninitialize = {\r\n apiVersion: 1,\r\n supports: {\r\n pages: {\r\n appButton: {},\r\n tabs: {},\r\n config: {},\r\n backStack: {},\r\n fullTrust: {},\r\n },\r\n teamsCore: {},\r\n logs: {},\r\n },\r\n};\r\n","/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\r\n/* eslint-disable @typescript-eslint/ban-types */\r\n/* eslint-disable @typescript-eslint/no-unused-vars */\r\n\r\nimport { sendMessageToParent } from '../internal/communication';\r\nimport { GlobalVars } from '../internal/globalVars';\r\nimport { registerHandler, removeHandler } from '../internal/handlers';\r\nimport { ensureInitialized } from '../internal/internalAPIs';\r\nimport { DialogDimension, errorNotSupportedOnPlatform, FrameContexts } from './constants';\r\nimport { BotUrlDialogInfo, DialogInfo, DialogSize, UrlDialogInfo } from './interfaces';\r\nimport { runtime } from './runtime';\r\n\r\n/**\r\n * Namespace to interact with the dialog module-specific part of the SDK.\r\n *\r\n * @beta\r\n */\r\nexport namespace dialog {\r\n /**\r\n * Data Structure to represent the SDK response when dialog closes\r\n */\r\n export interface ISdkResponse {\r\n /**\r\n * Error in case there is a failure before dialog submission\r\n */\r\n err?: string;\r\n\r\n /**\r\n * Result value that the dialog is submitted with using {@linkcode submit} function\r\n *\r\n */\r\n result?: string | object;\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n export type PostMessageChannel = (message: any) => void;\r\n export type DialogSubmitHandler = (result: ISdkResponse) => void;\r\n const storedMessages: string[] = [];\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs because this function is only used during initialization\r\n * ------------------\r\n * Adds register handlers for messageForChild upon initialization and only in the tasks FrameContext. {@link FrameContexts.task}\r\n * Function is called during app intitialization\r\n * @internal\r\n */\r\n export function initialize(): void {\r\n registerHandler('messageForChild', handleDialogMessage, false);\r\n }\r\n\r\n function handleDialogMessage(message: string): void {\r\n if (!GlobalVars.frameContext) {\r\n // GlobalVars.frameContext is currently not set\r\n return;\r\n }\r\n\r\n if (GlobalVars.frameContext === FrameContexts.task) {\r\n storedMessages.push(message);\r\n } else {\r\n // Not in task FrameContext, remove 'messageForChild' handler\r\n removeHandler('messageForChild');\r\n }\r\n }\r\n\r\n /**\r\n * Allows app to open a url based dialog.\r\n *\r\n * @remarks\r\n * This function cannot be called from inside of a dialog\r\n *\r\n * @param urlDialogInfo - An object containing the parameters of the dialog module.\r\n * @param submitHandler - Handler that triggers when a dialog calls the {@linkcode submit} function or when the user closes the dialog.\r\n * @param messageFromChildHandler - Handler that triggers if dialog sends a message to the app.\r\n *\r\n * @returns a function that can be used to send messages to the dialog.\r\n */\r\n export function open(\r\n urlDialogInfo: UrlDialogInfo,\r\n submitHandler?: DialogSubmitHandler,\r\n messageFromChildHandler?: PostMessageChannel,\r\n ): void {\r\n ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n\r\n if (messageFromChildHandler) {\r\n registerHandler('messageForParent', messageFromChildHandler);\r\n }\r\n const dialogInfo: DialogInfo = getDialogInfoFromUrlDialogInfo(urlDialogInfo);\r\n sendMessageToParent('tasks.startTask', [dialogInfo], (err: string, result: string | object) => {\r\n submitHandler({ err, result });\r\n removeHandler('messageForParent');\r\n });\r\n }\r\n\r\n /**\r\n * Submit the dialog module.\r\n *\r\n * @param result - The result to be sent to the bot or the app. Typically a JSON object or a serialized version of it\r\n * @param appIds - Helps to validate that the call originates from the same appId as the one that invoked the task module\r\n */\r\n export function submit(result?: string | object, appIds?: string | string[]): void {\r\n ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.meetingStage);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n\r\n // Send tasks.completeTask instead of tasks.submitTask message for backward compatibility with Mobile clients\r\n sendMessageToParent('tasks.completeTask', [result, appIds ? (Array.isArray(appIds) ? appIds : [appIds]) : []]);\r\n }\r\n\r\n /**\r\n * Send message to the parent from dialog\r\n *\r\n * @remarks\r\n * This function is only called from inside of a dialog\r\n *\r\n * @param message - The message to send to the parent\r\n */\r\n export function sendMessageToParentFromDialog(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n message: any,\r\n ): void {\r\n ensureInitialized(FrameContexts.task);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n\r\n sendMessageToParent('messageForParent', [message]);\r\n }\r\n\r\n /**\r\n * Send message to the dialog from the parent\r\n *\r\n * @param message - The message to send\r\n */\r\n export function sendMessageToDialog(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n message: any,\r\n ): void {\r\n ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n\r\n sendMessageToParent('messageForChild', [message]);\r\n }\r\n\r\n /**\r\n * Register a listener that will be triggered when a message is received from the app that opened the dialog.\r\n *\r\n * @remarks\r\n * This function is only called from inside of a dialog.\r\n *\r\n * @param listener - The listener that will be triggered.\r\n */\r\n export function registerOnMessageFromParent(listener: PostMessageChannel): void {\r\n ensureInitialized(FrameContexts.task);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n\r\n // We need to remove the original 'messageForChild'\r\n // handler since the original does not allow for post messages.\r\n // It is replaced by the user specified listener that is passed in.\r\n removeHandler('messageForChild');\r\n registerHandler('messageForChild', listener);\r\n storedMessages.reverse();\r\n while (storedMessages.length > 0) {\r\n const message = storedMessages.pop();\r\n listener(message);\r\n }\r\n }\r\n\r\n /**\r\n * Checks if dialog module is supported by the host\r\n *\r\n * @returns boolean to represent whether dialog module is supported\r\n */\r\n export function isSupported(): boolean {\r\n return runtime.supports.dialog ? true : false;\r\n }\r\n\r\n /**\r\n * Namespace to update the dialog\r\n */\r\n export namespace update {\r\n /**\r\n * Update dimensions - height/width of a dialog.\r\n *\r\n * @param dimensions - An object containing width and height properties.\r\n */\r\n export function resize(dimensions: DialogSize): void {\r\n ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.meetingStage);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n sendMessageToParent('tasks.updateTask', [dimensions]);\r\n }\r\n\r\n /**\r\n * Checks if dialog.update capability is supported by the host\r\n *\r\n * @returns boolean to represent whether dialog.update is supported\r\n */\r\n export function isSupported(): boolean {\r\n return runtime.supports.dialog ? (runtime.supports.dialog.update ? true : false) : false;\r\n }\r\n }\r\n\r\n /**\r\n * Namespace to open a dialog that sends results to the bot framework\r\n */\r\n export namespace bot {\r\n /**\r\n * Allows an app to open the dialog module using bot.\r\n *\r\n * @param botUrlDialogInfo - An object containing the parameters of the dialog module including completionBotId.\r\n * @param submitHandler - Handler that triggers when the dialog has been submitted or closed.\r\n * @param messageFromChildHandler - Handler that triggers if dialog sends a message to the app.\r\n *\r\n * @returns a function that can be used to send messages to the dialog.\r\n */\r\n export function open(\r\n botUrlDialogInfo: BotUrlDialogInfo,\r\n submitHandler?: DialogSubmitHandler,\r\n messageFromChildHandler?: PostMessageChannel,\r\n ): void {\r\n ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n if (messageFromChildHandler) {\r\n registerHandler('messageForParent', messageFromChildHandler);\r\n }\r\n const dialogInfo: DialogInfo = getDialogInfoFromBotUrlDialogInfo(botUrlDialogInfo);\r\n\r\n sendMessageToParent('tasks.startTask', [dialogInfo], (err: string, result: string | object) => {\r\n submitHandler({ err, result });\r\n removeHandler('messageForParent');\r\n });\r\n }\r\n\r\n /**\r\n * Checks if dialog.bot capability is supported by the host\r\n *\r\n * @returns boolean to represent whether dialog.bot is supported\r\n */\r\n export function isSupported(): boolean {\r\n return runtime.supports.dialog ? (runtime.supports.dialog.bot ? true : false) : false;\r\n }\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * --------\r\n * Convert UrlDialogInfo to DialogInfo to send the information to host in {@linkcode open} API.\r\n *\r\n * @internal\r\n */\r\n export function getDialogInfoFromUrlDialogInfo(urlDialogInfo: UrlDialogInfo): DialogInfo {\r\n const dialogInfo: DialogInfo = {\r\n url: urlDialogInfo.url,\r\n height: urlDialogInfo.size ? urlDialogInfo.size.height : DialogDimension.Small,\r\n width: urlDialogInfo.size ? urlDialogInfo.size.width : DialogDimension.Small,\r\n title: urlDialogInfo.title,\r\n fallbackUrl: urlDialogInfo.fallbackUrl,\r\n };\r\n return dialogInfo;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * --------\r\n * Convert BotUrlDialogInfo to DialogInfo to send the information to host in {@linkcode bot.open} API.\r\n *\r\n * @internal\r\n */\r\n export function getDialogInfoFromBotUrlDialogInfo(botUrlDialogInfo: BotUrlDialogInfo): DialogInfo {\r\n const dialogInfo: DialogInfo = {\r\n url: botUrlDialogInfo.url,\r\n height: botUrlDialogInfo.size ? botUrlDialogInfo.size.height : DialogDimension.Small,\r\n width: botUrlDialogInfo.size ? botUrlDialogInfo.size.width : DialogDimension.Small,\r\n title: botUrlDialogInfo.title,\r\n fallbackUrl: botUrlDialogInfo.fallbackUrl,\r\n completionBotId: botUrlDialogInfo.completionBotId,\r\n };\r\n return dialogInfo;\r\n }\r\n}\r\n","import { sendMessageToParent } from '../internal/communication';\r\nimport { registerHandler } from '../internal/handlers';\r\nimport { ensureInitialized } from '../internal/internalAPIs';\r\nimport { runtime } from '../public/runtime';\r\nimport { errorNotSupportedOnPlatform } from './constants';\r\n\r\n/**\r\n * Namespace to interact with the menu-specific part of the SDK.\r\n * This object is used to show View Configuration, Action Menu and Navigation Bar Menu.\r\n */\r\nexport namespace menus {\r\n /**\r\n * @hidden\r\n * Represents information about item in View Configuration.\r\n */\r\n export interface ViewConfiguration {\r\n /**\r\n * @hidden\r\n * Unique identifier of view.\r\n */\r\n id: string;\r\n /**\r\n * @hidden\r\n * Display title of the view.\r\n */\r\n title: string;\r\n /**\r\n * @hidden\r\n * Additional information for accessibility.\r\n */\r\n contentDescription?: string;\r\n }\r\n\r\n /**\r\n * Defines how a menu item should appear in the NavBar.\r\n */\r\n export enum DisplayMode {\r\n /**\r\n * Only place this item in the NavBar if there's room for it.\r\n * If there's no room, item is shown in the overflow menu.\r\n */\r\n ifRoom = 0,\r\n /**\r\n * Never place this item in the NavBar.\r\n * The item would always be shown in NavBar's overflow menu.\r\n */\r\n overflowOnly = 1,\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Represents information about menu item for Action Menu and Navigation Bar Menu.\r\n */\r\n export class MenuItem {\r\n /**\r\n * @hidden\r\n * Unique identifier for the menu item.\r\n */\r\n public id: string;\r\n /**\r\n * @hidden\r\n * Display title of the menu item.\r\n */\r\n public title: string;\r\n /**\r\n * @hidden\r\n * Display icon of the menu item. The icon value must be a string having SVG icon content.\r\n */\r\n public icon: string;\r\n /**\r\n * @hidden\r\n * Selected state display icon of the menu item. The icon value must be a string having SVG icon content.\r\n */\r\n public iconSelected?: string;\r\n /**\r\n * @hidden\r\n * Additional information for accessibility.\r\n */\r\n public contentDescription?: string;\r\n /**\r\n * @hidden\r\n * State of the menu item\r\n */\r\n public enabled = true;\r\n /**\r\n * @hidden\r\n * Interface to show list of items on selection of menu item.\r\n */\r\n public viewData?: ViewData;\r\n /**\r\n * @hidden\r\n * Whether the menu item is selected or not\r\n */\r\n public selected = false;\r\n /**\r\n * The Display Mode of the menu item.\r\n * Default Behaviour would be DisplayMode.ifRoom if null.\r\n * Refer {@link DisplayMode}\r\n */\r\n public displayMode?: DisplayMode;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Represents information about view to show on Navigation Bar Menu item selection\r\n */\r\n export interface ViewData {\r\n /**\r\n * @hidden\r\n * Display header title of the item list.\r\n */\r\n listTitle?: string;\r\n /**\r\n * @hidden\r\n * Type of the menu item.\r\n */\r\n listType: MenuListType;\r\n /**\r\n * @hidden\r\n * Array of MenuItem. Icon value will be required for all items in the list.\r\n */\r\n listItems: MenuItem[];\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Represents information about type of list to display in Navigation Bar Menu.\r\n */\r\n export enum MenuListType {\r\n dropDown = 'dropDown',\r\n popOver = 'popOver',\r\n }\r\n let navBarMenuItemPressHandler: (id: string) => boolean;\r\n let actionMenuItemPressHandler: (id: string) => boolean;\r\n let viewConfigItemPressHandler: (id: string) => boolean;\r\n\r\n export function initialize(): void {\r\n registerHandler('navBarMenuItemPress', handleNavBarMenuItemPress, false);\r\n registerHandler('actionMenuItemPress', handleActionMenuItemPress, false);\r\n registerHandler('setModuleView', handleViewConfigItemPress, false);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Registers list of view configurations and it's handler.\r\n * Handler is responsible for listening selection of View Configuration.\r\n *\r\n * @param viewConfig - List of view configurations. Minimum 1 value is required.\r\n * @param handler - The handler to invoke when the user selects view configuration.\r\n */\r\n export function setUpViews(viewConfig: ViewConfiguration[], handler: (id: string) => boolean): void {\r\n ensureInitialized();\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n viewConfigItemPressHandler = handler;\r\n sendMessageToParent('setUpViews', [viewConfig]);\r\n }\r\n\r\n function handleViewConfigItemPress(id: string): void {\r\n if (!viewConfigItemPressHandler || !viewConfigItemPressHandler(id)) {\r\n ensureInitialized();\r\n sendMessageToParent('viewConfigItemPress', [id]);\r\n }\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Used to set menu items on the Navigation Bar. If icon is available, icon will be shown, otherwise title will be shown.\r\n *\r\n * @param items List of MenuItems for Navigation Bar Menu.\r\n * @param handler The handler to invoke when the user selects menu item.\r\n */\r\n export function setNavBarMenu(items: MenuItem[], handler: (id: string) => boolean): void {\r\n ensureInitialized();\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n navBarMenuItemPressHandler = handler;\r\n sendMessageToParent('setNavBarMenu', [items]);\r\n }\r\n\r\n function handleNavBarMenuItemPress(id: string): void {\r\n if (!navBarMenuItemPressHandler || !navBarMenuItemPressHandler(id)) {\r\n ensureInitialized();\r\n sendMessageToParent('handleNavBarMenuItemPress', [id]);\r\n }\r\n }\r\n\r\n export interface ActionMenuParameters {\r\n /**\r\n * @hidden\r\n * Display title for Action Menu\r\n */\r\n title: string;\r\n /**\r\n * @hidden\r\n * List of MenuItems for Action Menu\r\n */\r\n items: MenuItem[];\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Used to show Action Menu.\r\n *\r\n * @param params - Parameters for Menu Parameters\r\n * @param handler - The handler to invoke when the user selects menu item.\r\n */\r\n export function showActionMenu(params: ActionMenuParameters, handler: (id: string) => boolean): void {\r\n ensureInitialized();\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n actionMenuItemPressHandler = handler;\r\n sendMessageToParent('showActionMenu', [params]);\r\n }\r\n\r\n function handleActionMenuItemPress(id: string): void {\r\n if (!actionMenuItemPressHandler || !actionMenuItemPressHandler(id)) {\r\n ensureInitialized();\r\n sendMessageToParent('handleActionMenuItemPress', [id]);\r\n }\r\n }\r\n\r\n export function isSupported(): boolean {\r\n return runtime.supports.menus ? true : false;\r\n }\r\n}\r\n","import { GlobalVars } from '../internal/globalVars';\r\nimport * as Handlers from '../internal/handlers'; // Conflict with some names\r\nimport { ensureInitialized } from '../internal/internalAPIs';\r\nimport { errorNotSupportedOnPlatform } from './constants';\r\nimport { LoadContext } from './interfaces';\r\nimport { runtime } from './runtime';\r\n\r\n/**\r\n * Namespace containing the set of APIs that support Teams-specific functionalities.\r\n */\r\n\r\nexport namespace teamsCore {\r\n /**\r\n * Enable print capability to support printing page using Ctrl+P and cmd+P\r\n */\r\n export function enablePrintCapability(): void {\r\n if (!GlobalVars.printCapabilityEnabled) {\r\n ensureInitialized();\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n GlobalVars.printCapabilityEnabled = true;\r\n // adding ctrl+P and cmd+P handler\r\n document.addEventListener('keydown', (event: KeyboardEvent) => {\r\n if ((event.ctrlKey || event.metaKey) && event.keyCode === 80) {\r\n print();\r\n event.cancelBubble = true;\r\n event.preventDefault();\r\n event.stopImmediatePropagation();\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * default print handler\r\n */\r\n export function print(): void {\r\n window.print();\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Registers a handler to be called when the page has been requested to load.\r\n *\r\n * @param handler - The handler to invoke when the page is loaded.\r\n *\r\n * @internal\r\n */\r\n export function registerOnLoadHandler(handler: (context: LoadContext) => void): void {\r\n ensureInitialized();\r\n\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n\r\n Handlers.registerOnLoadHandler(handler);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Registers a handler to be called before the page is unloaded.\r\n *\r\n * @param handler - The handler to invoke before the page is unloaded. If this handler returns true the page should\r\n * invoke the readyToUnload function provided to it once it's ready to be unloaded.\r\n *\r\n * @internal\r\n */\r\n export function registerBeforeUnloadHandler(handler: (readyToUnload: () => void) => boolean): void {\r\n ensureInitialized();\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n Handlers.registerBeforeUnloadHandler(handler);\r\n }\r\n\r\n /**\r\n * Checks if teamsCore capability is supported by the host\r\n * @returns true if the teamsCore capability is enabled in runtime.supports.teamsCore and\r\n * false if it is disabled\r\n */\r\n export function isSupported(): boolean {\r\n return runtime.supports.teamsCore ? true : false;\r\n }\r\n}\r\n","/* eslint-disable @typescript-eslint/no-empty-function */\r\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\r\n/* eslint-disable @typescript-eslint/no-explicit-any */\r\n\r\nimport {\r\n Communication,\r\n initializeCommunication,\r\n sendAndHandleStatusAndReason as send,\r\n sendAndUnwrap,\r\n sendMessageToParent,\r\n uninitializeCommunication,\r\n} from '../internal/communication';\r\nimport { defaultSDKVersionForCompatCheck, version } from '../internal/constants';\r\nimport { GlobalVars } from '../internal/globalVars';\r\nimport * as Handlers from '../internal/handlers'; // Conflict with some names\r\nimport { ensureInitialized, processAdditionalValidOrigins } from '../internal/internalAPIs';\r\nimport { compareSDKVersions, runWithTimeout } from '../internal/utils';\r\nimport { logs } from '../private/logs';\r\nimport { initializePrivateApis } from '../private/privateAPIs';\r\nimport { authentication } from './authentication';\r\nimport { ChannelType, FrameContexts, HostClientType, HostName, TeamType, UserTeamRole } from './constants';\r\nimport { dialog } from './dialog';\r\nimport { Context as LegacyContext, FileOpenPreference, LocaleInfo } from './interfaces';\r\nimport { menus } from './menus';\r\nimport { pages } from './pages';\r\nimport { applyRuntimeConfig, generateBackCompatRuntimeConfig, IRuntime } from './runtime';\r\nimport { teamsCore } from './teamsAPIs';\r\n\r\n/**\r\n * Namespace to interact with app initialization and lifecycle.\r\n *\r\n * @beta\r\n */\r\nexport namespace app {\r\n // ::::::::::::::::::::::: MicrosoftTeams client SDK public API ::::::::::::::::::::\r\n\r\n export const Messages = {\r\n AppLoaded: 'appInitialization.appLoaded',\r\n Success: 'appInitialization.success',\r\n Failure: 'appInitialization.failure',\r\n ExpectedFailure: 'appInitialization.expectedFailure',\r\n };\r\n\r\n /**\r\n * Describes errors that caused app initialization to fail\r\n */\r\n export enum FailedReason {\r\n /**\r\n * Authentication failed\r\n */\r\n AuthFailed = 'AuthFailed',\r\n /**\r\n * The application timed out\r\n */\r\n Timeout = 'Timeout',\r\n /**\r\n * The app failed for a different reason\r\n */\r\n Other = 'Other',\r\n }\r\n\r\n /**\r\n * Describes expected errors that occurred during an otherwise successful\r\n * app initialization\r\n */\r\n export enum ExpectedFailureReason {\r\n /**\r\n * There was a permission error\r\n */\r\n PermissionError = 'PermissionError',\r\n /**\r\n * The item was not found\r\n */\r\n NotFound = 'NotFound',\r\n /**\r\n * The network is currently throttled\r\n */\r\n Throttling = 'Throttling',\r\n /**\r\n * The application is currently offline\r\n */\r\n Offline = 'Offline',\r\n /**\r\n * The app failed for a different reason\r\n */\r\n Other = 'Other',\r\n }\r\n\r\n /**\r\n * Represents the failed request sent during a failed app initialization.\r\n */\r\n export interface IFailedRequest {\r\n /**\r\n * The reason for the failure\r\n */\r\n reason: FailedReason;\r\n /**\r\n * A message that describes the failure\r\n */\r\n message?: string;\r\n }\r\n\r\n /**\r\n * Represents the failure request sent during an erroneous app initialization.\r\n */\r\n export interface IExpectedFailureRequest {\r\n /**\r\n * The reason for the failure\r\n */\r\n reason: ExpectedFailureReason;\r\n /**\r\n * A message that describes the failure\r\n */\r\n message?: string;\r\n }\r\n\r\n /**\r\n * Represents application information.\r\n */\r\n export interface AppInfo {\r\n /**\r\n * The current locale that the user has configured for the app formatted as\r\n * languageId-countryId (for example, en-us).\r\n */\r\n locale: string;\r\n\r\n /**\r\n * The current UI theme.\r\n */\r\n theme: string;\r\n\r\n /**\r\n * Unique ID for the current session for use in correlating telemetry data.\r\n */\r\n sessionId: string;\r\n\r\n /**\r\n * Info of the host\r\n */\r\n host: AppHostInfo;\r\n\r\n /**\r\n * More detailed locale info from the user's OS if available. Can be used together with\r\n * the @microsoft/globe NPM package to ensure your app respects the user's OS date and\r\n * time format configuration\r\n */\r\n osLocaleInfo?: LocaleInfo;\r\n /**\r\n * Personal app icon y coordinate position\r\n */\r\n iconPositionVertical?: number;\r\n\r\n /**\r\n * Time when the user clicked on the tab\r\n */\r\n userClickTime?: number;\r\n\r\n /**\r\n * The ID of the parent message from which this task module was launched.\r\n * This is only available in task modules launched from bot cards.\r\n */\r\n parentMessageId?: string;\r\n\r\n /**\r\n * Where the user prefers the file to be opened from by default during file open\r\n */\r\n userFileOpenPreference?: FileOpenPreference;\r\n\r\n /**\r\n * ID for the current visible app which is different for across cached sessions. Used for correlating telemetry data.\r\n */\r\n appLaunchId?: string;\r\n }\r\n\r\n /**\r\n * Represents information about the application's host.\r\n */\r\n export interface AppHostInfo {\r\n /**\r\n * The name of the host client. Possible values are: Office, Orange, Outlook, Teams\r\n */\r\n name: HostName;\r\n\r\n /**\r\n * The type of the host client. Possible values are : android, ios, web, desktop, rigel\r\n */\r\n clientType: HostClientType;\r\n\r\n /**\r\n * Unique ID for the current Host session for use in correlating telemetry data.\r\n */\r\n sessionId: string;\r\n\r\n /**\r\n * Current ring ID\r\n */\r\n ringId?: string;\r\n }\r\n\r\n /**\r\n * Represents Channel information.\r\n */\r\n export interface ChannelInfo {\r\n /**\r\n * The Microsoft Teams ID for the channel with which the content is associated.\r\n */\r\n id: string;\r\n\r\n /**\r\n * The name for the channel with which the content is associated.\r\n */\r\n displayName?: string;\r\n\r\n /**\r\n * The relative path to the SharePoint folder associated with the channel.\r\n */\r\n relativeUrl?: string;\r\n\r\n /**\r\n * The type of the channel with which the content is associated.\r\n */\r\n membershipType?: ChannelType;\r\n\r\n /**\r\n * The OneNote section ID that is linked to the channel.\r\n */\r\n defaultOneNoteSectionId?: string;\r\n\r\n /**\r\n * The tenant ID of the team which owns the channel.\r\n */\r\n ownerTenantId?: string;\r\n\r\n /**\r\n * The AAD group ID of the team which owns the channel.\r\n */\r\n ownerGroupId?: string;\r\n }\r\n\r\n /**\r\n * Represents Chat information.\r\n */\r\n export interface ChatInfo {\r\n /**\r\n * The Microsoft Teams ID for the chat with which the content is associated.\r\n */\r\n id: string;\r\n }\r\n\r\n /**\r\n * Represents Meeting information.\r\n */\r\n export interface MeetingInfo {\r\n /**\r\n * Meeting Id used by tab when running in meeting context\r\n */\r\n id: string;\r\n }\r\n\r\n /**\r\n * Represents Page information.\r\n */\r\n export interface PageInfo {\r\n /**\r\n * The developer-defined unique ID for the page this content points to.\r\n */\r\n id: string;\r\n\r\n /**\r\n * The context where page url is loaded (content, task, setting, remove, sidePanel)\r\n */\r\n frameContext: FrameContexts;\r\n\r\n /**\r\n * The developer-defined unique ID for the sub-page this content points to.\r\n * This field should be used to restore to a specific state within a page,\r\n * such as scrolling to or activating a specific piece of content.\r\n */\r\n subPageId?: string;\r\n\r\n /**\r\n * Indication whether the page is in full-screen mode.\r\n */\r\n isFullScreen?: boolean;\r\n\r\n /**\r\n * Indication whether the page is in a pop out window\r\n */\r\n isMultiWindow?: boolean;\r\n\r\n /**\r\n * Source origin from where the page is opened\r\n */\r\n sourceOrigin?: string;\r\n }\r\n\r\n /**\r\n * Represents Team information.\r\n */\r\n export interface TeamInfo {\r\n /**\r\n * The Microsoft Teams ID for the team with which the content is associated.\r\n */\r\n internalId: string;\r\n\r\n /**\r\n * The name for the team with which the content is associated.\r\n */\r\n displayName?: string;\r\n\r\n /**\r\n * The type of the team.\r\n */\r\n type?: TeamType;\r\n\r\n /**\r\n * The Office 365 group ID for the team with which the content is associated.\r\n * This field is available only when the identity permission is requested in the manifest.\r\n */\r\n groupId?: string;\r\n\r\n /**\r\n * Indicates whether team is archived.\r\n * Apps should use this as a signal to prevent any changes to content associated with archived teams.\r\n */\r\n isArchived?: boolean;\r\n\r\n /**\r\n * Team Template ID if there was a Team Template associated with the creation of the team.\r\n */\r\n templateId?: string;\r\n\r\n /**\r\n * The user's role in the team.\r\n * Because a malicious party can run your content in a browser, this value should\r\n * be used only as a hint as to the user's role, and never as proof of her role.\r\n */\r\n userRole?: UserTeamRole;\r\n }\r\n\r\n /**\r\n * Represents User information.\r\n */\r\n export interface UserInfo {\r\n /**\r\n * The Azure AD object id of the current user.\r\n * Because a malicious party run your content in a browser, this value should\r\n * be used only as a hint as to who the user is and never as proof of identity.\r\n * This field is available only when the identity permission is requested in the manifest.\r\n */\r\n id: string;\r\n\r\n /**\r\n * The address book name of the current user.\r\n */\r\n displayName?: string;\r\n\r\n /**\r\n * Represents whether calling is allowed for the current logged in User\r\n */\r\n isCallingAllowed?: boolean;\r\n\r\n /**\r\n * Represents whether PSTN calling is allowed for the current logged in User\r\n */\r\n isPSTNCallingAllowed?: boolean;\r\n\r\n /**\r\n * The license type for the current user.\r\n */\r\n licenseType?: string;\r\n\r\n /**\r\n * A value suitable for use as a login_hint when authenticating with Azure AD.\r\n * Because a malicious party can run your content in a browser, this value should\r\n * be used only as a hint as to who the user is and never as proof of identity.\r\n * This field is available only when the identity permission is requested in the manifest.\r\n */\r\n loginHint?: string;\r\n\r\n /**\r\n * The UPN of the current user. This may be an externally-authenticated UPN (e.g., guest users).\r\n * Because a malicious party run your content in a browser, this value should\r\n * be used only as a hint as to who the user is and never as proof of identity.\r\n * This field is available only when the identity permission is requested in the manifest.\r\n */\r\n userPrincipalName?: string;\r\n\r\n /**\r\n * The tenant related info of the current user.\r\n */\r\n tenant?: TenantInfo;\r\n }\r\n\r\n /**\r\n * Represents Tenant information.\r\n */\r\n export interface TenantInfo {\r\n /**\r\n * The Azure AD tenant ID of the current user.\r\n * Because a malicious party can run your content in a browser, this value should\r\n * be used only as a hint as to who the user is and never as proof of identity.\r\n * This field is available only when the identity permission is requested in the manifest.\r\n */\r\n id: string;\r\n\r\n /**\r\n * The type of license for the current users tenant.\r\n */\r\n teamsSku?: string;\r\n }\r\n\r\n export interface SharePointSiteInfo {\r\n /**\r\n * The root SharePoint site associated with the team.\r\n */\r\n teamSiteUrl?: string;\r\n\r\n /**\r\n * The domain of the root SharePoint site associated with the team.\r\n */\r\n teamSiteDomain?: string;\r\n\r\n /**\r\n * The relative path to the SharePoint site associated with the team.\r\n */\r\n teamSitePath?: string;\r\n\r\n /**\r\n * Teamsite ID, aka sharepoint site id.\r\n */\r\n teamSiteId?: string;\r\n\r\n /**\r\n * The SharePoint my site domain associated with the user.\r\n */\r\n mySiteDomain?: string;\r\n\r\n /**\r\n * The SharePoint relative path to the current users mysite\r\n */\r\n mySitePath?: string;\r\n }\r\n\r\n /**\r\n * Represents structure of the received context message.\r\n */\r\n export interface Context {\r\n /**\r\n * Info of the app\r\n */\r\n app: AppInfo;\r\n\r\n /**\r\n * Info of the current page of App\r\n */\r\n page: PageInfo;\r\n\r\n /**\r\n * Info of the user\r\n */\r\n user?: UserInfo;\r\n\r\n /**\r\n * Info of the Microsoft Teams channel\r\n */\r\n channel?: ChannelInfo;\r\n\r\n /**\r\n * Info of the Microsoft Teams chat\r\n */\r\n chat?: ChatInfo;\r\n\r\n /**\r\n * Info of the Microsoft Teams meeting\r\n */\r\n meeting?: MeetingInfo;\r\n\r\n /**\r\n * SharePoint context. This is only available when hosted in SharePoint.\r\n */\r\n sharepoint?: any;\r\n\r\n /**\r\n * Info of the sharePoint site associated with the team.\r\n */\r\n sharePointSite?: SharePointSiteInfo;\r\n\r\n /**\r\n * Info of the Microsoft Teams team\r\n */\r\n team?: TeamInfo;\r\n }\r\n\r\n /**\r\n * Checks whether the Teams client SDK has been initialized.\r\n * @returns whether the Teams client SDK has been initialized.\r\n */\r\n export function isInitialized(): boolean {\r\n return GlobalVars.initializeCalled;\r\n }\r\n\r\n /**\r\n * Gets the Frame Context that the App is running in. See {@link FrameContexts} for the list of possible values.\r\n * @returns the Frame Context.\r\n */\r\n export function getFrameContext(): FrameContexts {\r\n return GlobalVars.frameContext;\r\n }\r\n\r\n /**\r\n * Number of milliseconds we'll give the initialization call to return before timing it out\r\n */\r\n const initializationTimeoutInMs = 5000;\r\n\r\n /**\r\n * Initializes the library.\r\n *\r\n * @remarks\r\n * This must be called before any other SDK calls\r\n * but after the frame is loaded successfully.\r\n *\r\n * @param validMessageOrigins - Optionally specify a list of cross frame message origins. They must have\r\n * https: protocol otherwise they will be ignored. Example: https:www.example.com\r\n * @returns Promise that will be fulfilled when initialization has completed, or rejected if the initialization fails or times out\r\n */\r\n export function initialize(validMessageOrigins?: string[]): Promise {\r\n return runWithTimeout(\r\n () => initializeHelper(validMessageOrigins),\r\n initializationTimeoutInMs,\r\n new Error('SDK initialization timed out.'),\r\n );\r\n }\r\n\r\n function initializeHelper(validMessageOrigins?: string[]): Promise {\r\n return new Promise(resolve => {\r\n // Independent components might not know whether the SDK is initialized so might call it to be safe.\r\n // Just no-op if that happens to make it easier to use.\r\n if (!GlobalVars.initializeCalled) {\r\n GlobalVars.initializeCalled = true;\r\n\r\n Handlers.initializeHandlers();\r\n GlobalVars.initializePromise = initializeCommunication(validMessageOrigins).then(\r\n ({ context, clientType, runtimeConfig, clientSupportedSDKVersion = defaultSDKVersionForCompatCheck }) => {\r\n GlobalVars.frameContext = context;\r\n GlobalVars.hostClientType = clientType;\r\n GlobalVars.clientSupportedSDKVersion = clientSupportedSDKVersion;\r\n\r\n // Temporary workaround while the Host is updated with the new argument order.\r\n // For now, we might receive any of these possibilities:\r\n // - `runtimeConfig` in `runtimeConfig` and `clientSupportedSDKVersion` in `clientSupportedSDKVersion`.\r\n // - `runtimeConfig` in `clientSupportedSDKVersion` and `clientSupportedSDKVersion` in `runtimeConfig`.\r\n // - `clientSupportedSDKVersion` in `runtimeConfig` and no `clientSupportedSDKVersion`.\r\n // This code supports any of these possibilities\r\n\r\n // Teams AppHost won't provide this runtime config\r\n // so we assume that if we don't have it, we must be running in Teams.\r\n // After Teams updates its client code, we can remove this default code.\r\n try {\r\n const givenRuntimeConfig: IRuntime = JSON.parse(runtimeConfig);\r\n // Check that givenRuntimeConfig is a valid instance of IRuntimeConfig\r\n if (!givenRuntimeConfig || !givenRuntimeConfig.apiVersion) {\r\n throw new Error('Received runtime config is invalid');\r\n }\r\n runtimeConfig && applyRuntimeConfig(givenRuntimeConfig);\r\n } catch (e) {\r\n if (e instanceof SyntaxError) {\r\n try {\r\n // if the given runtime config was actually meant to be a SDK version, store it as such.\r\n // TODO: This is a temporary workaround to allow Teams to store clientSupportedSDKVersion even when\r\n // it doesn't provide the runtimeConfig. After Teams updates its client code, we should\r\n // remove this feature.\r\n if (!isNaN(compareSDKVersions(runtimeConfig, defaultSDKVersionForCompatCheck))) {\r\n GlobalVars.clientSupportedSDKVersion = runtimeConfig;\r\n }\r\n const givenRuntimeConfig: IRuntime = JSON.parse(clientSupportedSDKVersion);\r\n clientSupportedSDKVersion && applyRuntimeConfig(givenRuntimeConfig);\r\n } catch (e) {\r\n if (e instanceof SyntaxError) {\r\n applyRuntimeConfig(generateBackCompatRuntimeConfig(GlobalVars.clientSupportedSDKVersion));\r\n } else {\r\n throw e;\r\n }\r\n }\r\n } else {\r\n // If it's any error that's not a JSON parsing error, we want the program to fail.\r\n throw e;\r\n }\r\n }\r\n\r\n GlobalVars.initializeCompleted = true;\r\n },\r\n );\r\n\r\n authentication.initialize();\r\n menus.initialize();\r\n pages.config.initialize();\r\n dialog.initialize();\r\n initializePrivateApis();\r\n }\r\n\r\n // Handle additional valid message origins if specified\r\n if (Array.isArray(validMessageOrigins)) {\r\n processAdditionalValidOrigins(validMessageOrigins);\r\n }\r\n\r\n resolve(GlobalVars.initializePromise);\r\n });\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs.\r\n * ------\r\n * Undocumented function used to set a mock window for unit tests\r\n *\r\n * @internal\r\n */\r\n export function _initialize(hostWindow: any): void {\r\n Communication.currentWindow = hostWindow;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs.\r\n * ------\r\n * Undocumented function used to clear state between unit tests\r\n *\r\n * @internal\r\n */\r\n export function _uninitialize(): void {\r\n if (!GlobalVars.initializeCalled) {\r\n return;\r\n }\r\n\r\n if (GlobalVars.frameContext) {\r\n registerOnThemeChangeHandler(null);\r\n pages.backStack.registerBackButtonHandler(null);\r\n pages.registerFullScreenHandler(null);\r\n teamsCore.registerBeforeUnloadHandler(null);\r\n teamsCore.registerOnLoadHandler(null);\r\n logs.registerGetLogHandler(null);\r\n }\r\n\r\n if (GlobalVars.frameContext === FrameContexts.settings) {\r\n pages.config.registerOnSaveHandler(null);\r\n }\r\n\r\n if (GlobalVars.frameContext === FrameContexts.remove) {\r\n pages.config.registerOnRemoveHandler(null);\r\n }\r\n\r\n GlobalVars.initializeCalled = false;\r\n GlobalVars.initializeCompleted = false;\r\n GlobalVars.initializePromise = null;\r\n GlobalVars.additionalValidOrigins = [];\r\n GlobalVars.frameContext = null;\r\n GlobalVars.hostClientType = null;\r\n GlobalVars.isFramelessWindow = false;\r\n\r\n uninitializeCommunication();\r\n }\r\n\r\n /**\r\n * Retrieves the current context the frame is running in.\r\n *\r\n * @returns Promise that will resolve with the {@link app.Context} object.\r\n */\r\n export function getContext(): Promise {\r\n return new Promise(resolve => {\r\n ensureInitialized();\r\n resolve(sendAndUnwrap('getContext'));\r\n }).then(legacyContext => transformLegacyContextToAppContext(legacyContext)); // converts globalcontext to app.context\r\n }\r\n\r\n /**\r\n * Notifies the frame that app has loaded and to hide the loading indicator if one is shown.\r\n */\r\n export function notifyAppLoaded(): void {\r\n ensureInitialized();\r\n sendMessageToParent(Messages.AppLoaded, [version]);\r\n }\r\n\r\n /**\r\n * Notifies the frame that app initialization is successful and is ready for user interaction.\r\n */\r\n export function notifySuccess(): void {\r\n ensureInitialized();\r\n sendMessageToParent(Messages.Success, [version]);\r\n }\r\n\r\n /**\r\n * Notifies the frame that app initialization has failed and to show an error page in its place.\r\n *\r\n * @param appInitializationFailedRequest - The failure request containing the reason for why the app failed\r\n * during initialization as well as an optional message.\r\n */\r\n export function notifyFailure(appInitializationFailedRequest: IFailedRequest): void {\r\n ensureInitialized();\r\n sendMessageToParent(Messages.Failure, [\r\n appInitializationFailedRequest.reason,\r\n appInitializationFailedRequest.message,\r\n ]);\r\n }\r\n\r\n /**\r\n * Notifies the frame that app initialized with some expected errors.\r\n *\r\n * @param expectedFailureRequest - The expected failure request containing the reason and an optional message\r\n */\r\n export function notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void {\r\n ensureInitialized();\r\n sendMessageToParent(Messages.ExpectedFailure, [expectedFailureRequest.reason, expectedFailureRequest.message]);\r\n }\r\n\r\n /**\r\n * Registers a handler for theme changes.\r\n *\r\n * @remarks\r\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\r\n *\r\n * @param handler - The handler to invoke when the user changes their theme.\r\n */\r\n export function registerOnThemeChangeHandler(handler: (theme: string) => void): void {\r\n ensureInitialized();\r\n Handlers.registerOnThemeChangeHandler(handler);\r\n }\r\n\r\n /**\r\n * open link API.\r\n *\r\n * @param deepLink - deep link.\r\n * @returns Promise that will be fulfilled when the operation has completed\r\n */\r\n export function openLink(deepLink: string): Promise {\r\n return new Promise(resolve => {\r\n ensureInitialized(\r\n FrameContexts.content,\r\n FrameContexts.sidePanel,\r\n FrameContexts.settings,\r\n FrameContexts.task,\r\n FrameContexts.stage,\r\n FrameContexts.meetingStage,\r\n );\r\n resolve(send('executeDeepLink', deepLink));\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Transforms the Legacy Context object received from Messages to the structured app.Context object\r\n *\r\n * @internal\r\n */\r\nfunction transformLegacyContextToAppContext(legacyContext: LegacyContext): app.Context {\r\n const context: app.Context = {\r\n app: {\r\n locale: legacyContext.locale,\r\n sessionId: legacyContext.appSessionId ? legacyContext.appSessionId : '',\r\n theme: legacyContext.theme ? legacyContext.theme : 'default',\r\n iconPositionVertical: legacyContext.appIconPosition,\r\n osLocaleInfo: legacyContext.osLocaleInfo,\r\n parentMessageId: legacyContext.parentMessageId,\r\n userClickTime: legacyContext.userClickTime,\r\n userFileOpenPreference: legacyContext.userFileOpenPreference,\r\n host: {\r\n name: legacyContext.hostName ? legacyContext.hostName : HostName.teams,\r\n clientType: legacyContext.hostClientType ? legacyContext.hostClientType : HostClientType.web,\r\n sessionId: legacyContext.sessionId ? legacyContext.sessionId : '',\r\n ringId: legacyContext.ringId,\r\n },\r\n appLaunchId: legacyContext.appLaunchId,\r\n },\r\n page: {\r\n id: legacyContext.entityId,\r\n frameContext: legacyContext.frameContext ? legacyContext.frameContext : GlobalVars.frameContext,\r\n subPageId: legacyContext.subEntityId,\r\n isFullScreen: legacyContext.isFullScreen,\r\n isMultiWindow: legacyContext.isMultiWindow,\r\n sourceOrigin: legacyContext.sourceOrigin,\r\n },\r\n user: {\r\n id: legacyContext.userObjectId,\r\n displayName: legacyContext.userDisplayName,\r\n isCallingAllowed: legacyContext.isCallingAllowed,\r\n isPSTNCallingAllowed: legacyContext.isPSTNCallingAllowed,\r\n licenseType: legacyContext.userLicenseType,\r\n loginHint: legacyContext.loginHint,\r\n userPrincipalName: legacyContext.userPrincipalName,\r\n tenant: legacyContext.tid\r\n ? {\r\n id: legacyContext.tid,\r\n teamsSku: legacyContext.tenantSKU,\r\n }\r\n : undefined,\r\n },\r\n channel: legacyContext.channelId\r\n ? {\r\n id: legacyContext.channelId,\r\n displayName: legacyContext.channelName,\r\n relativeUrl: legacyContext.channelRelativeUrl,\r\n membershipType: legacyContext.channelType,\r\n defaultOneNoteSectionId: legacyContext.defaultOneNoteSectionId,\r\n ownerGroupId: legacyContext.hostTeamGroupId,\r\n ownerTenantId: legacyContext.hostTeamTenantId,\r\n }\r\n : undefined,\r\n chat: legacyContext.chatId\r\n ? {\r\n id: legacyContext.chatId,\r\n }\r\n : undefined,\r\n meeting: legacyContext.meetingId\r\n ? {\r\n id: legacyContext.meetingId,\r\n }\r\n : undefined,\r\n sharepoint: legacyContext.sharepoint,\r\n team: legacyContext.teamId\r\n ? {\r\n internalId: legacyContext.teamId,\r\n displayName: legacyContext.teamName,\r\n type: legacyContext.teamType,\r\n groupId: legacyContext.groupId,\r\n templateId: legacyContext.teamTemplateId,\r\n isArchived: legacyContext.isTeamArchived,\r\n userRole: legacyContext.userTeamRole,\r\n }\r\n : undefined,\r\n sharePointSite:\r\n legacyContext.teamSiteUrl ||\r\n legacyContext.teamSiteDomain ||\r\n legacyContext.teamSitePath ||\r\n legacyContext.mySitePath ||\r\n legacyContext.mySiteDomain\r\n ? {\r\n teamSiteUrl: legacyContext.teamSiteUrl,\r\n teamSiteDomain: legacyContext.teamSiteDomain,\r\n teamSitePath: legacyContext.teamSitePath,\r\n teamSiteId: legacyContext.teamSiteId,\r\n mySitePath: legacyContext.mySitePath,\r\n mySiteDomain: legacyContext.mySiteDomain,\r\n }\r\n : undefined,\r\n };\r\n\r\n return context;\r\n}\r\n","import {\r\n sendAndHandleStatusAndReason as send,\r\n sendAndHandleStatusAndReasonWithDefaultError as sendAndDefaultError,\r\n sendAndUnwrap,\r\n sendMessageToParent,\r\n} from '../internal/communication';\r\nimport { registerHandler } from '../internal/handlers';\r\nimport { ensureInitialized } from '../internal/internalAPIs';\r\nimport { createTeamsAppLink } from '../internal/utils';\r\nimport { app } from './app';\r\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\r\nimport { FrameInfo, ShareDeepLinkParameters, TabInformation, TabInstance, TabInstanceParameters } from './interfaces';\r\nimport { runtime } from './runtime';\r\n\r\n/**\r\n * Navigation-specific part of the SDK.\r\n *\r\n * @beta\r\n */\r\nexport namespace pages {\r\n /**\r\n * Return focus to the host. Will move focus forward or backward based on where the application container falls in\r\n * the F6/tab order in the host.\r\n * @param navigateForward - Determines the direction to focus in host.\r\n */\r\n export function returnFocus(navigateForward?: boolean): void {\r\n ensureInitialized();\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n sendMessageToParent('returnFocus', [navigateForward]);\r\n }\r\n\r\n /**\r\n * @hidden\r\n *\r\n * Registers a handler for specifying focus when it passes from the host to the application.\r\n *\r\n * @param handler - The handler for placing focus within the application.\r\n *\r\n * @internal\r\n */\r\n export function registerFocusEnterHandler(handler: (navigateForward: boolean) => void): void {\r\n ensureInitialized();\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n registerHandler('focusEnter', handler);\r\n }\r\n\r\n /**\r\n * Sets/Updates the current frame with new information\r\n *\r\n * @param frameInfo - Frame information containing the URL used in the iframe on reload and the URL for when the\r\n * user clicks 'Go To Website'\r\n */\r\n export function setCurrentFrame(frameInfo: FrameInfo): void {\r\n ensureInitialized(FrameContexts.content);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n sendMessageToParent('setFrameContext', [frameInfo]);\r\n }\r\n\r\n /**\r\n * Initializes the library with context information for the frame\r\n *\r\n * @param frameInfo - Frame information containing the URL used in the iframe on reload and the URL for when the\r\n * user clicks 'Go To Website'\r\n * @param callback - An optional callback that is executed once the application has finished initialization.\r\n * @param validMessageOrigins - An optional list of cross-frame message origins. They must have\r\n * https: protocol otherwise they will be ignored. Example: https:www.example.com\r\n */\r\n export function initializeWithFrameContext(\r\n frameInfo: FrameInfo,\r\n callback?: () => void,\r\n validMessageOrigins?: string[],\r\n ): void {\r\n app.initialize(validMessageOrigins).then(() => callback && callback());\r\n setCurrentFrame(frameInfo);\r\n }\r\n\r\n /**\r\n * Defines the configuration of the current or desired instance\r\n */\r\n export interface InstanceConfig {\r\n /**\r\n * A suggested display name for the new content.\r\n * In the settings for an existing instance being updated, this call has no effect.\r\n */\r\n suggestedDisplayName?: string;\r\n /**\r\n * Sets the URL to use for the content of this instance.\r\n */\r\n contentUrl: string;\r\n /**\r\n * Sets the URL for the removal configuration experience.\r\n */\r\n removeUrl?: string;\r\n /**\r\n * Sets the URL to use for the external link to view the underlying resource in a browser.\r\n */\r\n websiteUrl?: string;\r\n /**\r\n * The developer-defined unique ID for the entity to which this content points.\r\n */\r\n entityId?: string;\r\n }\r\n\r\n /**\r\n * Gets the config for the current instance.\r\n * @returns Promise that resolves with the {@link InstanceConfig} object.\r\n */\r\n export function getConfig(): Promise {\r\n return new Promise(resolve => {\r\n ensureInitialized(FrameContexts.content, FrameContexts.settings, FrameContexts.remove, FrameContexts.sidePanel);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n resolve(sendAndUnwrap('settings.getSettings'));\r\n });\r\n }\r\n\r\n /**\r\n * Navigates the frame to a new cross-domain URL. The domain of this URL must match at least one of the\r\n * valid domains specified in the validDomains block of the manifest; otherwise, an exception will be\r\n * thrown. This function needs to be used only when navigating the frame to a URL in a different domain\r\n * than the current one in a way that keeps the application informed of the change and allows the SDK to\r\n * continue working.\r\n * @param url - The URL to navigate the frame to.\r\n * @returns Promise that resolves when the navigation has completed.\r\n */\r\n export function navigateCrossDomain(url: string): Promise {\r\n return new Promise(resolve => {\r\n ensureInitialized(\r\n FrameContexts.content,\r\n FrameContexts.sidePanel,\r\n FrameContexts.settings,\r\n FrameContexts.remove,\r\n FrameContexts.task,\r\n FrameContexts.stage,\r\n FrameContexts.meetingStage,\r\n );\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n const errorMessage =\r\n 'Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.';\r\n resolve(sendAndDefaultError('navigateCrossDomain', errorMessage, url));\r\n });\r\n }\r\n\r\n /**\r\n * Navigate to the given application ID and page ID, with optional parameters for a WebURL (if the application\r\n * cannot be navigated to, such as if it is not installed), Channel ID (for applications installed as a channel tab),\r\n * and sub-page ID (for navigating to specific content within the page). This is equivalent to navigating to\r\n * a deep link with the above data, but does not require the application to build a URL or worry about different\r\n * deep link formats for different hosts.\r\n * @param params - Parameters for the navigation\r\n * @returns a promise that will resolve if the navigation was successful\r\n */\r\n export function navigateToApp(params: NavigateToAppParams): Promise {\r\n return new Promise(resolve => {\r\n ensureInitialized(\r\n FrameContexts.content,\r\n FrameContexts.sidePanel,\r\n FrameContexts.settings,\r\n FrameContexts.task,\r\n FrameContexts.stage,\r\n FrameContexts.meetingStage,\r\n );\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n if (runtime.isLegacyTeams) {\r\n resolve(send('executeDeepLink', createTeamsAppLink(params)));\r\n } else {\r\n resolve(send('pages.navigateToApp', params));\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Shares a deep link that a user can use to navigate back to a specific state in this page.\r\n *\r\n * @param deepLinkParameters - ID and label for the link and fallback URL.\r\n */\r\n export function shareDeepLink(deepLinkParameters: ShareDeepLinkParameters): void {\r\n ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n sendMessageToParent('shareDeepLink', [\r\n deepLinkParameters.subPageId,\r\n deepLinkParameters.subPageLabel,\r\n deepLinkParameters.subPageWebUrl,\r\n ]);\r\n }\r\n\r\n /**\r\n * Registers a handler for changes from or to full-screen view for a tab.\r\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\r\n * @param handler - The handler to invoke when the user toggles full-screen view for a tab.\r\n */\r\n export function registerFullScreenHandler(handler: (isFullScreen: boolean) => void): void {\r\n ensureInitialized();\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n registerHandler('fullScreenChange', handler);\r\n }\r\n\r\n /**\r\n * Checks if the pages capability is supported by the host\r\n * @returns true if the pages capability is enabled in runtime.supports.pages and\r\n * false if it is disabled\r\n */\r\n export function isSupported(): boolean {\r\n return runtime.supports.pages ? true : false;\r\n }\r\n\r\n /**\r\n * Parameters for the NavigateToApp API\r\n */\r\n export interface NavigateToAppParams {\r\n /**\r\n * ID of the application to navigate to\r\n */\r\n appId: string;\r\n\r\n /**\r\n * Developer-defined ID of the Page to navigate to within the application (Formerly EntityID)\r\n */\r\n pageId: string;\r\n\r\n /**\r\n * Optional URL to open if the navigation cannot be completed within the host\r\n */\r\n webUrl?: string;\r\n\r\n /**\r\n * Optional developer-defined ID describing the content to navigate to within the Page. This will be passed\r\n * back to the application via the Context object.\r\n */\r\n subPageId?: string;\r\n\r\n /**\r\n * Optional ID of the Teams Channel where the application should be opened\r\n */\r\n channelId?: string;\r\n }\r\n\r\n /**\r\n * Provides APIs for querying and navigating between contextual tabs of an application. Unlike personal tabs,\r\n * contextual tabs are pages associated with a specific context, such as channel or chat.\r\n */\r\n export namespace tabs {\r\n /**\r\n * Navigates the hosted application to the specified tab instance.\r\n * @param tabInstance - The destination tab instance.\r\n * @returns Promise that resolves when the navigation has completed.\r\n */\r\n export function navigateToTab(tabInstance: TabInstance): Promise {\r\n return new Promise(resolve => {\r\n ensureInitialized();\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n const errorMessage = 'Invalid internalTabInstanceId and/or channelId were/was provided';\r\n resolve(sendAndDefaultError('navigateToTab', errorMessage, tabInstance));\r\n });\r\n }\r\n /**\r\n * Retrieves application tabs for the current user.\r\n * If no TabInstanceParameters are passed, the application defaults to favorite teams and favorite channels.\r\n * @param tabInstanceParameters - An optional set of flags that specify whether to scope call to favorite teams or channels.\r\n * @returns Promise that resolves with the {@link TabInformation}. Contains information for the user's tabs that are owned by this application {@link TabInstance}.\r\n */\r\n export function getTabInstances(tabInstanceParameters?: TabInstanceParameters): Promise {\r\n return new Promise(resolve => {\r\n ensureInitialized();\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n resolve(sendAndUnwrap('getTabInstances', tabInstanceParameters));\r\n });\r\n }\r\n\r\n /**\r\n * Retrieves the most recently used application tabs for the current user.\r\n * @param tabInstanceParameters - An optional set of flags. Note this is currently ignored and kept for future use.\r\n * @returns Promise that resolves with the {@link TabInformation}. Contains information for the users' most recently used tabs {@link TabInstance}.\r\n */\r\n export function getMruTabInstances(tabInstanceParameters?: TabInstanceParameters): Promise {\r\n return new Promise(resolve => {\r\n ensureInitialized();\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n resolve(sendAndUnwrap('getMruTabInstances', tabInstanceParameters));\r\n });\r\n }\r\n\r\n /**\r\n * Checks if the pages.tab capability is supported by the host\r\n * @returns true if the pages.tabs capability is enabled in runtime.supports.pages.tabs and\r\n * false if it is disabled\r\n */\r\n export function isSupported(): boolean {\r\n return runtime.supports.pages ? (runtime.supports.pages.tabs ? true : false) : false;\r\n }\r\n }\r\n /**\r\n * Provides APIs to interact with the configuration-specific part of the SDK.\r\n * This object is usable only on the configuration frame.\r\n */\r\n export namespace config {\r\n let saveHandler: (evt: SaveEvent) => void;\r\n let removeHandler: (evt: RemoveEvent) => void;\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs because this function is only used during initialization\r\n * ------------------\r\n * Adds register handlers for settings.save and settings.remove upon initialization. Function is called in {@link app.initializeHelper}\r\n * @internal\r\n */\r\n export function initialize(): void {\r\n registerHandler('settings.save', handleSave, false);\r\n registerHandler('settings.remove', handleRemove, false);\r\n }\r\n\r\n /**\r\n * Sets the validity state for the configuration.\r\n * The initial value is false, so the user cannot save the configuration until this is called with true.\r\n * @param validityState - Indicates whether the save or remove button is enabled for the user.\r\n */\r\n export function setValidityState(validityState: boolean): void {\r\n ensureInitialized(FrameContexts.settings, FrameContexts.remove);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n sendMessageToParent('settings.setValidityState', [validityState]);\r\n }\r\n\r\n /**\r\n * Sets the configuration for the current instance.\r\n * This is an asynchronous operation; calls to getConfig are not guaranteed to reflect the changed state.\r\n * @param instanceConfig - The desired configuration for this instance.\r\n * @returns Promise that resolves when the operation has completed.\r\n */\r\n export function setConfig(instanceConfig: InstanceConfig): Promise {\r\n return new Promise(resolve => {\r\n ensureInitialized(FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n resolve(send('settings.setSettings', instanceConfig));\r\n });\r\n }\r\n\r\n /**\r\n * Registers a handler for when the user attempts to save the configuration. This handler should be used\r\n * to create or update the underlying resource powering the content.\r\n * The object passed to the handler must be used to notify whether to proceed with the save.\r\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\r\n * @param handler - The handler to invoke when the user selects the Save button.\r\n */\r\n export function registerOnSaveHandler(handler: (evt: SaveEvent) => void): void {\r\n ensureInitialized(FrameContexts.settings);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n saveHandler = handler;\r\n handler && sendMessageToParent('registerHandler', ['save']);\r\n }\r\n\r\n /**\r\n * Registers a handler for user attempts to remove content. This handler should be used\r\n * to remove the underlying resource powering the content.\r\n * The object passed to the handler must be used to indicate whether to proceed with the removal.\r\n * Only one handler may be registered at a time. Subsequent registrations will override the first.\r\n * @param handler - The handler to invoke when the user selects the Remove button.\r\n */\r\n export function registerOnRemoveHandler(handler: (evt: RemoveEvent) => void): void {\r\n ensureInitialized(FrameContexts.remove, FrameContexts.settings);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n removeHandler = handler;\r\n handler && sendMessageToParent('registerHandler', ['remove']);\r\n }\r\n\r\n function handleSave(result?: SaveParameters): void {\r\n const saveEvent = new SaveEventImpl(result);\r\n if (saveHandler) {\r\n saveHandler(saveEvent);\r\n } else {\r\n // If no handler is registered, we assume success.\r\n saveEvent.notifySuccess();\r\n }\r\n }\r\n\r\n /**\r\n * Registers a handler for when the tab configuration is changed by the user\r\n * @param handler - The handler to invoke when the user clicks on Settings.\r\n */\r\n export function registerChangeConfigHandler(handler: () => void): void {\r\n ensureInitialized(FrameContexts.content);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n registerHandler('changeSettings', handler);\r\n }\r\n\r\n /**\r\n * Describes the results of the settings.save event. Includes result, notifySuccess, and notifyFailure\r\n * to indicate the return object (result) and the status of whether the settings.save call succeeded or not and why.\r\n */\r\n export interface SaveEvent {\r\n /**\r\n * Object containing properties passed as arguments to the settings.save event.\r\n */\r\n result: SaveParameters;\r\n /**\r\n * Indicates that the underlying resource has been created and the config can be saved.\r\n */\r\n notifySuccess(): void;\r\n /**\r\n * Indicates that creation of the underlying resource failed and that the config cannot be saved.\r\n * @param reason - Specifies a reason for the failure. If provided, this string is displayed to the user; otherwise a generic error is displayed.\r\n */\r\n notifyFailure(reason?: string): void;\r\n }\r\n\r\n /**\r\n * Describes the results of the settings.remove event. Includes notifySuccess, and notifyFailure\r\n * to indicate the status of whether the settings.save call succeeded or not and why.\r\n */\r\n export interface RemoveEvent {\r\n /**\r\n * Indicates that the underlying resource has been removed and the content can be removed.\r\n */\r\n notifySuccess(): void;\r\n /**\r\n * Indicates that removal of the underlying resource failed and that the content cannot be removed.\r\n * @param reason - Specifies a reason for the failure. If provided, this string is displayed to the user; otherwise a generic error is displayed.\r\n */\r\n notifyFailure(reason?: string): void;\r\n }\r\n\r\n /**\r\n * Parameters used in the settings.save event\r\n */\r\n export interface SaveParameters {\r\n /**\r\n * Connector's webhook Url returned as arguments to settings.save event as part of user clicking on Save\r\n */\r\n webhookUrl?: string;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs, since this class is not directly used.\r\n */\r\n class SaveEventImpl implements SaveEvent {\r\n public notified = false;\r\n public result: SaveParameters;\r\n public constructor(result?: SaveParameters) {\r\n this.result = result ? result : {};\r\n }\r\n public notifySuccess(): void {\r\n this.ensureNotNotified();\r\n sendMessageToParent('settings.save.success');\r\n this.notified = true;\r\n }\r\n public notifyFailure(reason?: string): void {\r\n this.ensureNotNotified();\r\n sendMessageToParent('settings.save.failure', [reason]);\r\n this.notified = true;\r\n }\r\n private ensureNotNotified(): void {\r\n if (this.notified) {\r\n throw new Error('The SaveEvent may only notify success or failure once.');\r\n }\r\n }\r\n }\r\n\r\n function handleRemove(): void {\r\n const removeEvent = new RemoveEventImpl();\r\n if (removeHandler) {\r\n removeHandler(removeEvent);\r\n } else {\r\n // If no handler is registered, we assume success.\r\n removeEvent.notifySuccess();\r\n }\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs, since this class is not directly used.\r\n */\r\n class RemoveEventImpl implements RemoveEvent {\r\n public notified = false;\r\n\r\n public notifySuccess(): void {\r\n this.ensureNotNotified();\r\n sendMessageToParent('settings.remove.success');\r\n this.notified = true;\r\n }\r\n\r\n public notifyFailure(reason?: string): void {\r\n this.ensureNotNotified();\r\n sendMessageToParent('settings.remove.failure', [reason]);\r\n this.notified = true;\r\n }\r\n\r\n private ensureNotNotified(): void {\r\n if (this.notified) {\r\n throw new Error('The removeEvent may only notify success or failure once.');\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Checks if the pages.config capability is supported by the host\r\n * @returns true if the pages.config capability is enabled in runtime.supports.pages.config and\r\n * false if it is disabled\r\n */\r\n export function isSupported(): boolean {\r\n return runtime.supports.pages ? (runtime.supports.pages.config ? true : false) : false;\r\n }\r\n }\r\n\r\n /**\r\n * Provides APIs for handling the user's navigational history.\r\n */\r\n export namespace backStack {\r\n let backButtonPressHandler: () => boolean;\r\n\r\n export function _initialize(): void {\r\n registerHandler('backButtonPress', handleBackButtonPress, false);\r\n }\r\n\r\n /**\r\n * Navigates back in the hosted application. See {@link pages.backStack.registerBackButtonHandler} for notes on usage.\r\n * @returns Promise that resolves when the navigation has completed.\r\n */\r\n export function navigateBack(): Promise {\r\n return new Promise(resolve => {\r\n ensureInitialized();\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n const errorMessage = 'Back navigation is not supported in the current client or context.';\r\n resolve(sendAndDefaultError('navigateBack', errorMessage));\r\n });\r\n }\r\n\r\n /**\r\n * Registers a handler for user presses of the host client's back button. Experiences that maintain an internal\r\n * navigation stack should use this handler to navigate the user back within their frame. If an application finds\r\n * that after running its back button handler it cannot handle the event it should call the navigateBack\r\n * method to ask the host client to handle it instead.\r\n * @param handler - The handler to invoke when the user presses the host client's back button.\r\n */\r\n export function registerBackButtonHandler(handler: () => boolean): void {\r\n ensureInitialized();\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n backButtonPressHandler = handler;\r\n handler && sendMessageToParent('registerHandler', ['backButton']);\r\n }\r\n\r\n function handleBackButtonPress(): void {\r\n if (!backButtonPressHandler || !backButtonPressHandler()) {\r\n navigateBack();\r\n }\r\n }\r\n\r\n /**\r\n * Checks if the pages.backStack capability is supported by the host\r\n * @returns true if the pages.backStack capability is enabled in runtime.supports.pages.backStack and\r\n * false if it is disabled\r\n */\r\n export function isSupported(): boolean {\r\n return runtime.supports.pages ? (runtime.supports.pages.backStack ? true : false) : false;\r\n }\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Provides APIs to interact with the full-trust part of the SDK. Limited to 1P applications\r\n */\r\n export namespace fullTrust {\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Place the tab into full-screen mode.\r\n */\r\n export function enterFullscreen(): void {\r\n ensureInitialized(FrameContexts.content);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n sendMessageToParent('enterFullscreen', []);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Reverts the tab into normal-screen mode.\r\n */\r\n export function exitFullscreen(): void {\r\n ensureInitialized(FrameContexts.content);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n sendMessageToParent('exitFullscreen', []);\r\n }\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Checks if the pages.fullTrust capability is supported by the host\r\n * @returns true if the pages.fullTrust capability is enabled in runtime.supports.pages.fullTrust and\r\n * false if it is disabled\r\n */\r\n export function isSupported(): boolean {\r\n return runtime.supports.pages ? (runtime.supports.pages.fullTrust ? true : false) : false;\r\n }\r\n }\r\n\r\n /**\r\n * Provides APIs to interact with the app button part of the SDK.\r\n */\r\n export namespace appButton {\r\n /**\r\n * Registers a handler for clicking the app button.\r\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\r\n * @param handler - The handler to invoke when the personal app button is clicked in the app bar.\r\n */\r\n export function onClick(handler: () => void): void {\r\n ensureInitialized(FrameContexts.content);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n registerHandler('appButtonClick', handler);\r\n }\r\n\r\n /**\r\n * Registers a handler for entering hover of the app button.\r\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\r\n * @param handler - The handler to invoke when entering hover of the personal app button in the app bar.\r\n */\r\n export function onHoverEnter(handler: () => void): void {\r\n ensureInitialized(FrameContexts.content);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n registerHandler('appButtonHoverEnter', handler);\r\n }\r\n\r\n /**\r\n * Registers a handler for exiting hover of the app button.\r\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\r\n * @param handler - The handler to invoke when exiting hover of the personal app button in the app bar.\r\n */\r\n export function onHoverLeave(handler: () => void): void {\r\n ensureInitialized(FrameContexts.content);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n registerHandler('appButtonHoverLeave', handler);\r\n }\r\n\r\n /**\r\n * Checks if pages.appButton capability is supported by the host\r\n * @returns true if the pages.appButton capability is enabled in runtime.supports.pages.appButton and\r\n * false if it is disabled\r\n */\r\n export function isSupported(): boolean {\r\n return runtime.supports.pages ? (runtime.supports.pages.appButton ? true : false) : false;\r\n }\r\n }\r\n}\r\n","import { debug as registerLogger, Debugger } from 'debug';\r\n\r\nconst topLevelLogger = registerLogger('teamsJs');\r\n\r\n/**\r\n * @internal\r\n *\r\n * Returns a logger for a given namespace, within the pre-defined top-level teamsJs namespace\r\n */\r\nexport function getLogger(namespace: string): Debugger {\r\n return topLevelLogger.extend(namespace);\r\n}\r\n","/* eslint-disable @typescript-eslint/ban-types */\r\n\r\nimport { LoadContext } from '../public';\r\nimport { pages } from '../public/pages';\r\nimport { Communication, sendMessageEventToChild, sendMessageToParent } from './communication';\r\nimport { getLogger } from './telemetry';\r\n\r\nconst handlersLogger = getLogger('handlers');\r\n\r\n/** @internal */\r\nclass HandlersPrivate {\r\n public static handlers: {\r\n [func: string]: Function;\r\n } = {};\r\n public static themeChangeHandler: (theme: string) => void;\r\n public static loadHandler: (context: LoadContext) => void;\r\n public static beforeUnloadHandler: (readyToUnload: () => void) => boolean;\r\n}\r\n\r\n/** @internal */\r\nexport function initializeHandlers(): void {\r\n // ::::::::::::::::::::MicrosoftTeams SDK Internal :::::::::::::::::\r\n HandlersPrivate.handlers['themeChange'] = handleThemeChange;\r\n HandlersPrivate.handlers['load'] = handleLoad;\r\n HandlersPrivate.handlers['beforeUnload'] = handleBeforeUnload;\r\n pages.backStack._initialize();\r\n}\r\n\r\nconst callHandlerLogger = handlersLogger.extend('callHandler');\r\n/** @internal */\r\nexport function callHandler(name: string, args?: unknown[]): [true, unknown] | [false, undefined] {\r\n const handler = HandlersPrivate.handlers[name];\r\n if (handler) {\r\n callHandlerLogger('Invoking the registered handler for message %s with arguments %o', name, args);\r\n const result = handler.apply(this, args);\r\n return [true, result];\r\n } else {\r\n callHandlerLogger('Handler for action message %s not found.', name);\r\n return [false, undefined];\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport function registerHandler(name: string, handler: Function, sendMessage = true, args: unknown[] = []): void {\r\n if (handler) {\r\n HandlersPrivate.handlers[name] = handler;\r\n sendMessage && sendMessageToParent('registerHandler', [name, ...args]);\r\n } else {\r\n delete HandlersPrivate.handlers[name];\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport function removeHandler(name: string): void {\r\n delete HandlersPrivate.handlers[name];\r\n}\r\n\r\n/** @internal */\r\nexport function registerOnThemeChangeHandler(handler: (theme: string) => void): void {\r\n HandlersPrivate.themeChangeHandler = handler;\r\n handler && sendMessageToParent('registerHandler', ['themeChange']);\r\n}\r\n\r\n/** @internal */\r\nexport function handleThemeChange(theme: string): void {\r\n if (HandlersPrivate.themeChangeHandler) {\r\n HandlersPrivate.themeChangeHandler(theme);\r\n }\r\n\r\n if (Communication.childWindow) {\r\n sendMessageEventToChild('themeChange', [theme]);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport function registerOnLoadHandler(handler: (context: LoadContext) => void): void {\r\n HandlersPrivate.loadHandler = handler;\r\n handler && sendMessageToParent('registerHandler', ['load']);\r\n}\r\n\r\n/** @internal */\r\nfunction handleLoad(context: LoadContext): void {\r\n if (HandlersPrivate.loadHandler) {\r\n HandlersPrivate.loadHandler(context);\r\n }\r\n\r\n if (Communication.childWindow) {\r\n sendMessageEventToChild('load', [context]);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport function registerBeforeUnloadHandler(handler: (readyToUnload: () => void) => boolean): void {\r\n HandlersPrivate.beforeUnloadHandler = handler;\r\n handler && sendMessageToParent('registerHandler', ['beforeUnload']);\r\n}\r\n\r\n/** @internal */\r\nfunction handleBeforeUnload(): void {\r\n const readyToUnload = (): void => {\r\n sendMessageToParent('readyToUnload', []);\r\n };\r\n\r\n if (!HandlersPrivate.beforeUnloadHandler || !HandlersPrivate.beforeUnloadHandler(readyToUnload)) {\r\n readyToUnload();\r\n }\r\n}\r\n","/* eslint-disable @typescript-eslint/ban-types */\r\n/* eslint-disable @typescript-eslint/no-explicit-any */\r\n\r\nimport { FrameContexts } from '../public/constants';\r\nimport { SdkError } from '../public/interfaces';\r\nimport { version } from './constants';\r\nimport { GlobalVars } from './globalVars';\r\nimport { callHandler } from './handlers';\r\nimport { DOMMessageEvent, ExtendedWindow, MessageRequest, MessageResponse } from './interfaces';\r\nimport { getLogger } from './telemetry';\r\nimport { validateOrigin } from './utils';\r\n\r\nconst communicationLogger = getLogger('communication');\r\n\r\n/**@internal */\r\nexport class Communication {\r\n public static currentWindow: Window | any;\r\n public static parentOrigin: string;\r\n public static parentWindow: Window | any;\r\n public static childWindow: Window;\r\n public static childOrigin: string;\r\n}\r\n\r\n/**@internal */\r\nclass CommunicationPrivate {\r\n public static parentMessageQueue: MessageRequest[] = [];\r\n public static childMessageQueue: MessageRequest[] = [];\r\n public static nextMessageId = 0;\r\n public static callbacks: {\r\n [id: number]: Function; // (arg1, arg2, ...etc) => void\r\n } = {};\r\n public static promiseCallbacks: {\r\n [id: number]: Function; // (args[]) => void\r\n } = {};\r\n public static messageListener: Function;\r\n}\r\n\r\n/**@internal */\r\ninterface InitializeResponse {\r\n context: FrameContexts;\r\n clientType: string;\r\n runtimeConfig: string;\r\n clientSupportedSDKVersion: string;\r\n}\r\n\r\n/**@internal */\r\nexport function initializeCommunication(validMessageOrigins: string[] | undefined): Promise {\r\n // Listen for messages post to our window\r\n CommunicationPrivate.messageListener = (evt: DOMMessageEvent): void => processMessage(evt);\r\n\r\n // If we are in an iframe, our parent window is the one hosting us (i.e., window.parent); otherwise,\r\n // it's the window that opened us (i.e., window.opener)\r\n Communication.currentWindow = Communication.currentWindow || window;\r\n Communication.parentWindow =\r\n Communication.currentWindow.parent !== Communication.currentWindow.self\r\n ? Communication.currentWindow.parent\r\n : Communication.currentWindow.opener;\r\n\r\n // Listen to messages from the parent or child frame.\r\n // Frameless windows will only receive this event from child frames and if validMessageOrigins is passed.\r\n if (Communication.parentWindow || validMessageOrigins) {\r\n Communication.currentWindow.addEventListener('message', CommunicationPrivate.messageListener, false);\r\n }\r\n\r\n if (!Communication.parentWindow) {\r\n const extendedWindow = (Communication.currentWindow as unknown) as ExtendedWindow;\r\n if (extendedWindow.nativeInterface) {\r\n GlobalVars.isFramelessWindow = true;\r\n extendedWindow.onNativeMessage = handleParentMessage;\r\n } else {\r\n // at this point we weren't able to find a parent to talk to, no way initialization will succeed\r\n return Promise.reject(new Error('Initialization Failed. No Parent window found.'));\r\n }\r\n }\r\n\r\n try {\r\n // Send the initialized message to any origin, because at this point we most likely don't know the origin\r\n // of the parent window, and this message contains no data that could pose a security risk.\r\n Communication.parentOrigin = '*';\r\n return sendMessageToParentAsync<[FrameContexts, string, string, string]>('initialize', [version]).then(\r\n ([context, clientType, runtimeConfig, clientSupportedSDKVersion]: [FrameContexts, string, string, string]) => {\r\n return { context, clientType, runtimeConfig, clientSupportedSDKVersion };\r\n },\r\n );\r\n } finally {\r\n Communication.parentOrigin = null;\r\n }\r\n}\r\n\r\n/**@internal */\r\nexport function uninitializeCommunication(): void {\r\n Communication.currentWindow.removeEventListener('message', CommunicationPrivate.messageListener, false);\r\n\r\n Communication.parentWindow = null;\r\n Communication.parentOrigin = null;\r\n Communication.childWindow = null;\r\n Communication.childOrigin = null;\r\n CommunicationPrivate.parentMessageQueue = [];\r\n CommunicationPrivate.childMessageQueue = [];\r\n CommunicationPrivate.nextMessageId = 0;\r\n CommunicationPrivate.callbacks = {};\r\n}\r\n\r\n/**@internal */\r\nexport function sendAndUnwrap(actionName: string, ...args: any[]): Promise {\r\n return sendMessageToParentAsync(actionName, args).then(([result]: [T]) => result);\r\n}\r\n\r\nexport function sendAndHandleStatusAndReason(actionName: string, ...args: any[]): Promise {\r\n return sendMessageToParentAsync(actionName, args).then(([status, reason]: [boolean, string]) => {\r\n if (!status) {\r\n throw new Error(reason);\r\n }\r\n });\r\n}\r\n\r\n/**@internal */\r\nexport function sendAndHandleStatusAndReasonWithDefaultError(\r\n actionName: string,\r\n defaultError: string,\r\n ...args: any[]\r\n): Promise {\r\n return sendMessageToParentAsync(actionName, args).then(([status, reason]: [boolean, string]) => {\r\n if (!status) {\r\n throw new Error(reason ? reason : defaultError);\r\n }\r\n });\r\n}\r\n\r\n/**@internal */\r\nexport function sendAndHandleSdkError(actionName: string, ...args: any[]): Promise {\r\n return sendMessageToParentAsync(actionName, args).then(([error, result]: [SdkError, T]) => {\r\n if (error) {\r\n throw error;\r\n }\r\n return result;\r\n });\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Send a message to parent. Uses nativeInterface on mobile to communicate with parent context\r\n *\r\n * @internal\r\n */\r\nexport function sendMessageToParentAsync(actionName: string, args: any[] = undefined): Promise {\r\n return new Promise(resolve => {\r\n const request = sendMessageToParentHelper(actionName, args);\r\n resolve(waitForResponse(request.id));\r\n });\r\n}\r\n\r\n/**@internal */\r\nfunction waitForResponse(requestId: number): Promise {\r\n return new Promise(resolve => {\r\n CommunicationPrivate.promiseCallbacks[requestId] = resolve;\r\n });\r\n}\r\n\r\n/**@internal */\r\nexport function sendMessageToParent(actionName: string, callback?: Function): void;\r\n\r\n/**\r\n * @hidden\r\n * Send a message to parent. Uses nativeInterface on mobile to communicate with parent context\r\n *\r\n * @internal\r\n */\r\nexport function sendMessageToParent(actionName: string, args: any[], callback?: Function): void;\r\n\r\n/**@internal */\r\nexport function sendMessageToParent(actionName: string, argsOrCallback?: any[] | Function, callback?: Function): void {\r\n let args: any[] | undefined;\r\n if (argsOrCallback instanceof Function) {\r\n callback = argsOrCallback;\r\n } else if (argsOrCallback instanceof Array) {\r\n args = argsOrCallback;\r\n }\r\n\r\n const request = sendMessageToParentHelper(actionName, args);\r\n if (callback) {\r\n CommunicationPrivate.callbacks[request.id] = callback;\r\n }\r\n}\r\n\r\nconst sendMessageToParentHelperLogger = communicationLogger.extend('sendMessageToParentHelper');\r\n\r\n/**@internal */\r\nfunction sendMessageToParentHelper(actionName: string, args: any[]): MessageRequest {\r\n const logger = sendMessageToParentHelperLogger;\r\n\r\n const targetWindow = Communication.parentWindow;\r\n const request = createMessageRequest(actionName, args);\r\n\r\n logger('Message %i information: %o', request.id, { actionName, args });\r\n\r\n if (GlobalVars.isFramelessWindow) {\r\n if (Communication.currentWindow && Communication.currentWindow.nativeInterface) {\r\n logger('Sending message %i to parent via framelessPostMessage interface', request.id);\r\n (Communication.currentWindow as ExtendedWindow).nativeInterface.framelessPostMessage(JSON.stringify(request));\r\n }\r\n } else {\r\n const targetOrigin = getTargetOrigin(targetWindow);\r\n\r\n // If the target window isn't closed and we already know its origin, send the message right away; otherwise,\r\n // queue the message and send it after the origin is established\r\n if (targetWindow && targetOrigin) {\r\n logger('Sending message %i to parent via postMessage', request.id);\r\n targetWindow.postMessage(request, targetOrigin);\r\n } else {\r\n logger('Adding message %i to parent message queue', request.id);\r\n getTargetMessageQueue(targetWindow).push(request);\r\n }\r\n }\r\n return request;\r\n}\r\n\r\n/**@internal */\r\nexport function processMessage(evt: DOMMessageEvent): void {\r\n // Process only if we received a valid message\r\n if (!evt || !evt.data || typeof evt.data !== 'object') {\r\n return;\r\n }\r\n\r\n // Process only if the message is coming from a different window and a valid origin\r\n // valid origins are either a pre-known\r\n const messageSource = evt.source || (evt.originalEvent && evt.originalEvent.source);\r\n const messageOrigin = evt.origin || (evt.originalEvent && evt.originalEvent.origin);\r\n if (!shouldProcessMessage(messageSource, messageOrigin)) {\r\n return;\r\n }\r\n\r\n // Update our parent and child relationships based on this message\r\n updateRelationships(messageSource, messageOrigin);\r\n\r\n // Handle the message\r\n if (messageSource === Communication.parentWindow) {\r\n handleParentMessage(evt);\r\n } else if (messageSource === Communication.childWindow) {\r\n handleChildMessage(evt);\r\n }\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Validates the message source and origin, if it should be processed\r\n *\r\n * @internal\r\n */\r\nexport function shouldProcessMessage(messageSource: Window, messageOrigin: string): boolean {\r\n // Process if message source is a different window and if origin is either in\r\n // Teams' pre-known whitelist or supplied as valid origin by user during initialization\r\n if (Communication.currentWindow && messageSource === Communication.currentWindow) {\r\n return false;\r\n } else if (\r\n Communication.currentWindow &&\r\n Communication.currentWindow.location &&\r\n messageOrigin &&\r\n messageOrigin === Communication.currentWindow.location.origin\r\n ) {\r\n return true;\r\n } else {\r\n return validateOrigin(new URL(messageOrigin));\r\n }\r\n}\r\n\r\n/**@internal */\r\nfunction updateRelationships(messageSource: Window, messageOrigin: string): void {\r\n // Determine whether the source of the message is our parent or child and update our\r\n // window and origin pointer accordingly\r\n // For frameless windows (i.e mobile), there is no parent frame, so the message must be from the child.\r\n if (\r\n !GlobalVars.isFramelessWindow &&\r\n (!Communication.parentWindow || Communication.parentWindow.closed || messageSource === Communication.parentWindow)\r\n ) {\r\n Communication.parentWindow = messageSource;\r\n Communication.parentOrigin = messageOrigin;\r\n } else if (\r\n !Communication.childWindow ||\r\n Communication.childWindow.closed ||\r\n messageSource === Communication.childWindow\r\n ) {\r\n Communication.childWindow = messageSource;\r\n Communication.childOrigin = messageOrigin;\r\n }\r\n\r\n // Clean up pointers to closed parent and child windows\r\n if (Communication.parentWindow && Communication.parentWindow.closed) {\r\n Communication.parentWindow = null;\r\n Communication.parentOrigin = null;\r\n }\r\n if (Communication.childWindow && Communication.childWindow.closed) {\r\n Communication.childWindow = null;\r\n Communication.childOrigin = null;\r\n }\r\n\r\n // If we have any messages in our queue, send them now\r\n flushMessageQueue(Communication.parentWindow);\r\n flushMessageQueue(Communication.childWindow);\r\n}\r\n\r\nconst handleParentMessageLogger = communicationLogger.extend('handleParentMessage');\r\n\r\n/**@internal */\r\nfunction handleParentMessage(evt: DOMMessageEvent): void {\r\n const logger = handleParentMessageLogger;\r\n\r\n if ('id' in evt.data && typeof evt.data.id === 'number') {\r\n // Call any associated Communication.callbacks\r\n const message = evt.data as MessageResponse;\r\n const callback = CommunicationPrivate.callbacks[message.id];\r\n logger('Received a response from parent for message %i', message.id);\r\n if (callback) {\r\n logger('Invoking the registered callback for message %i with arguments %o', message.id, message.args);\r\n callback.apply(null, [...message.args, message.isPartialResponse]);\r\n\r\n // Remove the callback to ensure that the callback is called only once and to free up memory if response is a complete response\r\n if (!isPartialResponse(evt)) {\r\n logger('Removing registered callback for message %i', message.id);\r\n delete CommunicationPrivate.callbacks[message.id];\r\n }\r\n }\r\n const promiseCallback = CommunicationPrivate.promiseCallbacks[message.id];\r\n if (promiseCallback) {\r\n logger('Invoking the registered promise callback for message %i with arguments %o', message.id, message.args);\r\n promiseCallback(message.args);\r\n\r\n logger('Removing registered promise callback for message %i', message.id);\r\n delete CommunicationPrivate.promiseCallbacks[message.id];\r\n }\r\n } else if ('func' in evt.data && typeof evt.data.func === 'string') {\r\n // Delegate the request to the proper handler\r\n const message = evt.data as MessageRequest;\r\n logger('Received an action message %s from parent', message.func);\r\n callHandler(message.func, message.args);\r\n } else {\r\n logger('Received an unknown message: %O', evt);\r\n }\r\n}\r\n\r\n/**@internal */\r\nfunction isPartialResponse(evt: DOMMessageEvent): boolean {\r\n return evt.data.isPartialResponse === true;\r\n}\r\n\r\n/**@internal */\r\nfunction handleChildMessage(evt: DOMMessageEvent): void {\r\n if ('id' in evt.data && 'func' in evt.data) {\r\n // Try to delegate the request to the proper handler, if defined\r\n const message = evt.data as MessageRequest;\r\n const [called, result] = callHandler(message.func, message.args);\r\n if (called && typeof result !== 'undefined') {\r\n sendMessageResponseToChild(message.id, Array.isArray(result) ? result : [result]);\r\n } else {\r\n // No handler, proxy to parent\r\n // tslint:disable-next-line:no-any\r\n sendMessageToParent(message.func, message.args, (...args: any[]): void => {\r\n if (Communication.childWindow) {\r\n const isPartialResponse = args.pop();\r\n sendMessageResponseToChild(message.id, args, isPartialResponse);\r\n }\r\n });\r\n }\r\n }\r\n}\r\n\r\n/**@internal */\r\nfunction getTargetMessageQueue(targetWindow: Window): MessageRequest[] {\r\n return targetWindow === Communication.parentWindow\r\n ? CommunicationPrivate.parentMessageQueue\r\n : targetWindow === Communication.childWindow\r\n ? CommunicationPrivate.childMessageQueue\r\n : [];\r\n}\r\n\r\n/**@internal */\r\nfunction getTargetOrigin(targetWindow: Window): string {\r\n return targetWindow === Communication.parentWindow\r\n ? Communication.parentOrigin\r\n : targetWindow === Communication.childWindow\r\n ? Communication.childOrigin\r\n : null;\r\n}\r\n\r\nconst flushMessageQueueLogger = communicationLogger.extend('flushMessageQueue');\r\n/**@internal */\r\nfunction flushMessageQueue(targetWindow: Window | any): void {\r\n const targetOrigin = getTargetOrigin(targetWindow);\r\n const targetMessageQueue = getTargetMessageQueue(targetWindow);\r\n const target = targetWindow == Communication.parentWindow ? 'parent' : 'child';\r\n while (targetWindow && targetOrigin && targetMessageQueue.length > 0) {\r\n const request = targetMessageQueue.shift();\r\n flushMessageQueueLogger('Flushing message %i from ' + target + ' message queue via postMessage.', request.id);\r\n targetWindow.postMessage(request, targetOrigin);\r\n }\r\n}\r\n\r\n/**@internal */\r\nexport function waitForMessageQueue(targetWindow: Window, callback: () => void): void {\r\n const messageQueueMonitor = Communication.currentWindow.setInterval(() => {\r\n if (getTargetMessageQueue(targetWindow).length === 0) {\r\n clearInterval(messageQueueMonitor);\r\n callback();\r\n }\r\n }, 100);\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Send a response to child for a message request that was from child\r\n *\r\n * @internal\r\n */\r\nfunction sendMessageResponseToChild(\r\n id: number,\r\n // tslint:disable-next-line:no-any\r\n args?: any[],\r\n isPartialResponse?: boolean,\r\n): void {\r\n const targetWindow = Communication.childWindow;\r\n const response = createMessageResponse(id, args, isPartialResponse);\r\n const targetOrigin = getTargetOrigin(targetWindow);\r\n if (targetWindow && targetOrigin) {\r\n targetWindow.postMessage(response, targetOrigin);\r\n }\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Send a custom message object that can be sent to child window,\r\n * instead of a response message to a child\r\n *\r\n * @internal\r\n */\r\nexport function sendMessageEventToChild(\r\n actionName: string,\r\n // tslint:disable-next-line: no-any\r\n args?: any[],\r\n): void {\r\n const targetWindow = Communication.childWindow;\r\n const customEvent = createMessageEvent(actionName, args);\r\n const targetOrigin = getTargetOrigin(targetWindow);\r\n\r\n // If the target window isn't closed and we already know its origin, send the message right away; otherwise,\r\n // queue the message and send it after the origin is established\r\n if (targetWindow && targetOrigin) {\r\n targetWindow.postMessage(customEvent, targetOrigin);\r\n } else {\r\n getTargetMessageQueue(targetWindow).push(customEvent);\r\n }\r\n}\r\n\r\n/**@internal */\r\n// tslint:disable-next-line:no-any\r\nfunction createMessageRequest(func: string, args: any[]): MessageRequest {\r\n return {\r\n id: CommunicationPrivate.nextMessageId++,\r\n func: func,\r\n timestamp: Date.now(),\r\n args: args || [],\r\n };\r\n}\r\n\r\n/**@internal */\r\n// tslint:disable-next-line:no-any\r\nfunction createMessageResponse(id: number, args: any[], isPartialResponse: boolean): MessageResponse {\r\n return {\r\n id: id,\r\n args: args || [],\r\n isPartialResponse,\r\n };\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Creates a message object without any id, used for custom actions being sent to child frame/window\r\n *\r\n * @internal\r\n */\r\n// tslint:disable-next-line:no-any\r\nfunction createMessageEvent(func: string, args: any[]): MessageRequest {\r\n return {\r\n func: func,\r\n args: args || [],\r\n };\r\n}\r\n","import { sendMessageToParent } from '../internal/communication';\r\nimport { registerHandler, removeHandler } from '../internal/handlers';\r\nimport { ensureInitialized } from '../internal/internalAPIs';\r\nimport { errorNotSupportedOnPlatform } from '../public/constants';\r\nimport { runtime } from '../public/runtime';\r\n\r\n/**\r\n * @hidden\r\n * Namespace to interact with the logging part of the SDK.\r\n * This object is used to send the app logs on demand to the host client\r\n *\r\n * Hide from docs\r\n *\r\n * @internal\r\n */\r\nexport namespace logs {\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Registers a handler for getting app log\r\n *\r\n * @param handler - The handler to invoke to get the app log\r\n */\r\n export function registerGetLogHandler(handler: () => string): void {\r\n ensureInitialized();\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n\r\n if (handler) {\r\n registerHandler('log.request', () => {\r\n const log: string = handler();\r\n sendMessageToParent('log.receive', [log]);\r\n });\r\n } else {\r\n removeHandler('log.request');\r\n }\r\n }\r\n\r\n export function isSupported(): boolean {\r\n return runtime.supports.logs ? true : false;\r\n }\r\n}\r\n","import { FileOpenPreference, TeamInformation } from '../public/interfaces';\r\n\r\n/**\r\n * @hidden\r\n * Hide from docs\r\n * --------\r\n * Information about all members in a chat\r\n */\r\nexport interface ChatMembersInformation {\r\n members: ThreadMember[];\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Hide from docs\r\n * --------\r\n * Information about a chat member\r\n */\r\nexport interface ThreadMember {\r\n /**\r\n * @hidden\r\n * The member's user principal name in the current tenant.\r\n */\r\n upn: string;\r\n}\r\n\r\nexport enum NotificationTypes {\r\n fileDownloadStart = 'fileDownloadStart',\r\n fileDownloadComplete = 'fileDownloadComplete',\r\n}\r\n\r\nexport interface ShowNotificationParameters {\r\n message: string;\r\n notificationType: NotificationTypes;\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Hide from docs.\r\n */\r\nexport enum ViewerActionTypes {\r\n view = 'view',\r\n edit = 'edit',\r\n editNew = 'editNew',\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Hide from docs.\r\n * ------\r\n * User setting changes that can be subscribed to\r\n */\r\nexport enum UserSettingTypes {\r\n /**\r\n * @hidden\r\n * Use this key to subscribe to changes in user's file open preference\r\n */\r\n fileOpenPreference = 'fileOpenPreference',\r\n /**\r\n * @hidden\r\n * Use this key to subscribe to theme changes\r\n */\r\n theme = 'theme',\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Hide from docs.\r\n */\r\nexport interface FilePreviewParameters {\r\n /**\r\n * @hidden\r\n * The developer-defined unique ID for the file.\r\n */\r\n entityId: string;\r\n\r\n /**\r\n * @hidden\r\n * The display name of the file.\r\n */\r\n title: string;\r\n\r\n /**\r\n * @hidden\r\n * An optional description of the file.\r\n */\r\n description?: string;\r\n\r\n /**\r\n * @hidden\r\n * The file extension; e.g. pptx, docx, etc.\r\n */\r\n type: string;\r\n\r\n /**\r\n * @hidden\r\n * A url to the source of the file, used to open the content in the user's default browser\r\n */\r\n objectUrl: string;\r\n\r\n /**\r\n * @hidden\r\n * Optional; an alternate self-authenticating url used to preview the file in Mobile clients and offer it for download by the user\r\n */\r\n downloadUrl?: string;\r\n\r\n /**\r\n * @hidden\r\n * Optional; an alternate url optimized for previewing the file in web and desktop clients\r\n */\r\n webPreviewUrl?: string;\r\n\r\n /**\r\n * @hidden\r\n * Optional; an alternate url that allows editing of the file in web and desktop clients\r\n */\r\n webEditUrl?: string;\r\n\r\n /**\r\n * @hidden\r\n * Optional; the base url of the site where the file is hosted\r\n */\r\n baseUrl?: string;\r\n\r\n /**\r\n * @hidden\r\n * Deprecated; prefer using viewerAction instead\r\n * Optional; indicates whether the file should be opened in edit mode\r\n */\r\n editFile?: boolean;\r\n\r\n /**\r\n * @hidden\r\n * Optional; the developer-defined unique ID for the sub-entity to return to when the file stage closes.\r\n * This field should be used to restore to a specific state within an entity, such as scrolling to or activating a specific piece of content.\r\n */\r\n subEntityId?: string;\r\n\r\n /**\r\n * @hidden\r\n * Optional; indicates the mode in which file should be opened. Takes precedence over edit mode.\r\n */\r\n viewerAction?: ViewerActionTypes;\r\n\r\n /**\r\n * @hidden\r\n * Optional; indicates how user prefers to open the file\r\n */\r\n fileOpenPreference?: FileOpenPreference;\r\n\r\n /**\r\n * Optional; id required to enable conversation button in files. Will be channel id in case file is shared in a channel or the chat id in p2p chat case.\r\n */\r\n conversationId?: string;\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Hide from docs\r\n * --------\r\n * Query parameters used when fetching team information\r\n */\r\nexport interface TeamInstanceParameters {\r\n /**\r\n * @hidden\r\n * Flag allowing to select favorite teams only\r\n */\r\n favoriteTeamsOnly?: boolean;\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Hide from docs\r\n * --------\r\n * Information on userJoined Teams\r\n */\r\nexport interface UserJoinedTeamsInformation {\r\n /**\r\n * @hidden\r\n * List of team information\r\n */\r\n userJoinedTeams: TeamInformation[];\r\n}\r\n","import {\r\n sendAndHandleStatusAndReason as sendAndHandleError,\r\n sendAndUnwrap,\r\n sendMessageToParent,\r\n} from '../internal/communication';\r\nimport { registerHandler, removeHandler } from '../internal/handlers';\r\nimport { ensureInitialized } from '../internal/internalAPIs';\r\nimport { errorNotSupportedOnPlatform, FrameContexts } from '../public/constants';\r\nimport { runtime } from '../public/runtime';\r\nimport { ChatMembersInformation } from './interfaces';\r\n\r\n/**\r\n * @hidden\r\n * Hide from docs.\r\n * ------\r\n *\r\n * @internal\r\n */\r\nexport interface OpenConversationRequest {\r\n /**\r\n * @hidden\r\n * The Id of the subEntity where the conversation is taking place\r\n */\r\n subEntityId: string;\r\n\r\n /**\r\n * @hidden\r\n * The title of the conversation\r\n */\r\n title: string;\r\n\r\n /**\r\n * @hidden\r\n * The Id of the conversation. This is optional and should be specified whenever a previous conversation about a specific sub-entity has already been started before\r\n */\r\n conversationId?: string;\r\n\r\n /**\r\n * @hidden\r\n * The Id of the channel. This is optional and should be specified whenever a conversation is started or opened in a personal app scope\r\n */\r\n channelId?: string;\r\n\r\n /**\r\n * @hidden\r\n * The entity Id of the tab\r\n */\r\n entityId: string;\r\n\r\n /**\r\n * @hidden\r\n * A function that is called once the conversation Id has been created\r\n */\r\n onStartConversation?: (conversationResponse: ConversationResponse) => void;\r\n\r\n /**\r\n * @hidden\r\n * A function that is called if the pane is closed\r\n */\r\n onCloseConversation?: (conversationResponse: ConversationResponse) => void;\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Hide from docs.\r\n * ------\r\n *\r\n * @internal\r\n */\r\nexport interface ConversationResponse {\r\n /**\r\n * @hidden\r\n * The Id of the subEntity where the conversation is taking place\r\n */\r\n subEntityId: string;\r\n\r\n /**\r\n * @hidden\r\n * The Id of the conversation. This is optional and should be specified whenever a previous conversation about a specific sub-entity has already been started before\r\n */\r\n conversationId?: string;\r\n\r\n /**\r\n * @hidden\r\n * The Id of the channel. This is optional and should be specified whenever a conversation is started or opened in a personal app scope\r\n */\r\n channelId?: string;\r\n\r\n /**\r\n * @hidden\r\n * The entity Id of the tab\r\n */\r\n entityId?: string;\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Namespace to interact with the conversational subEntities inside the tab\r\n */\r\nexport namespace conversations {\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * --------------\r\n * Allows the user to start or continue a conversation with each subentity inside the tab\r\n *\r\n * @returns Promise resolved upon completion\r\n */\r\n export function openConversation(openConversationRequest: OpenConversationRequest): Promise {\r\n return new Promise(resolve => {\r\n ensureInitialized(FrameContexts.content);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n const sendPromise = sendAndHandleError('conversations.openConversation', {\r\n title: openConversationRequest.title,\r\n subEntityId: openConversationRequest.subEntityId,\r\n conversationId: openConversationRequest.conversationId,\r\n channelId: openConversationRequest.channelId,\r\n entityId: openConversationRequest.entityId,\r\n });\r\n if (openConversationRequest.onStartConversation) {\r\n registerHandler(\r\n 'startConversation',\r\n (subEntityId: string, conversationId: string, channelId: string, entityId: string) =>\r\n openConversationRequest.onStartConversation({\r\n subEntityId,\r\n conversationId,\r\n channelId,\r\n entityId,\r\n }),\r\n );\r\n }\r\n if (openConversationRequest.onCloseConversation) {\r\n registerHandler(\r\n 'closeConversation',\r\n (subEntityId: string, conversationId?: string, channelId?: string, entityId?: string) =>\r\n openConversationRequest.onCloseConversation({\r\n subEntityId,\r\n conversationId,\r\n channelId,\r\n entityId,\r\n }),\r\n );\r\n }\r\n resolve(sendPromise);\r\n });\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * --------------\r\n * Allows the user to close the conversation in the right pane\r\n */\r\n export function closeConversation(): void {\r\n ensureInitialized(FrameContexts.content);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n sendMessageToParent('conversations.closeConversation');\r\n removeHandler('startConversation');\r\n removeHandler('closeConversation');\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Allows retrieval of information for all chat members.\r\n * NOTE: This value should be used only as a hint as to who the members are\r\n * and never as proof of membership in case your app is being hosted by a malicious party.\r\n *\r\n * @returns Promise resolved with information on all chat members\r\n *\r\n * @internal\r\n */\r\n export function getChatMembers(): Promise {\r\n return new Promise(resolve => {\r\n ensureInitialized();\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n resolve(sendAndUnwrap('getChatMembers'));\r\n });\r\n }\r\n\r\n export function isSupported(): boolean {\r\n return runtime.supports.conversations ? true : false;\r\n }\r\n}\r\n","/**\r\n * App install dialog constants\r\n */\r\nexport const teamsDeepLinkUrlPathForAppInstall = '/l/app/';\r\n\r\n/**\r\n * Calendar constants\r\n */\r\nexport const teamsDeepLinkUrlPathForCalendar = '/l/meeting/new';\r\nexport const teamsDeepLinkAttendeesUrlParameterName = 'attendees';\r\nexport const teamsDeepLinkStartTimeUrlParameterName = 'startTime';\r\nexport const teamsDeepLinkEndTimeUrlParameterName = 'endTime';\r\nexport const teamsDeepLinkSubjectUrlParameterName = 'subject';\r\nexport const teamsDeepLinkContentUrlParameterName = 'content';\r\n\r\n/**\r\n * Call constants\r\n */\r\nexport const teamsDeepLinkUrlPathForCall = '/l/call/0/0';\r\nexport const teamsDeepLinkSourceUrlParameterName = 'source';\r\nexport const teamsDeepLinkWithVideoUrlParameterName = 'withVideo';\r\n\r\n/**\r\n * Chat constants\r\n */\r\nexport const teamsDeepLinkUrlPathForChat = '/l/chat/0/0';\r\nexport const teamsDeepLinkUsersUrlParameterName = 'users';\r\nexport const teamsDeepLinkTopicUrlParameterName = 'topicName';\r\nexport const teamsDeepLinkMessageUrlParameterName = 'message';\r\n","import { sendMessageToParent } from '../internal/communication';\r\nimport { sendAndHandleStatusAndReason as sendAndHandleError } from '../internal/communication';\r\nimport { createTeamsDeepLinkForAppInstallDialog } from '../internal/deepLinkUtilities';\r\nimport { ensureInitialized } from '../internal/internalAPIs';\r\nimport { FrameContexts } from './constants';\r\nimport { runtime } from './runtime';\r\n\r\nexport namespace appInstallDialog {\r\n export interface OpenAppInstallDialogParams {\r\n appId: string;\r\n }\r\n\r\n export function openAppInstallDialog(openAPPInstallDialogParams: OpenAppInstallDialogParams): Promise {\r\n return new Promise(resolve => {\r\n ensureInitialized(\r\n FrameContexts.content,\r\n FrameContexts.sidePanel,\r\n FrameContexts.settings,\r\n FrameContexts.task,\r\n FrameContexts.stage,\r\n FrameContexts.meetingStage,\r\n );\r\n if (!isSupported()) {\r\n throw new Error('Not supported');\r\n }\r\n if (runtime.isLegacyTeams) {\r\n resolve(\r\n sendAndHandleError(\r\n 'executeDeepLink',\r\n createTeamsDeepLinkForAppInstallDialog(openAPPInstallDialogParams.appId),\r\n ),\r\n );\r\n } else {\r\n sendMessageToParent('appInstallDialog.openAppInstallDialog', [openAPPInstallDialogParams]);\r\n resolve();\r\n }\r\n });\r\n }\r\n\r\n export function isSupported(): boolean {\r\n return runtime.supports.appInstallDialog ? true : false;\r\n }\r\n}\r\n","import { sendAndHandleStatusAndReason as sendAndHandleError } from '../internal/communication';\r\nimport { createTeamsDeepLinkForChat } from '../internal/deepLinkUtilities';\r\nimport { ensureInitialized } from '../internal/internalAPIs';\r\nimport { errorNotSupportedOnPlatform, FrameContexts } from '../public/constants';\r\nimport { runtime } from '../public/runtime';\r\n\r\n/**\r\n * Describes information needed to start a chat\r\n *\r\n * @beta\r\n */\r\ninterface OpenChatRequest {\r\n /**\r\n * An optional message used when initiating chat\r\n */\r\n message?: string;\r\n}\r\n\r\n/**\r\n * Used when starting a chat with one person\r\n *\r\n * @see OpenGroupChatRequest for use when a chat with more than one person\r\n *\r\n * @beta\r\n */\r\nexport interface OpenSingleChatRequest extends OpenChatRequest {\r\n /**\r\n * The Azure Active Directory UPN (e-mail address) of the user to chat with\r\n */\r\n user: string;\r\n}\r\n\r\n/**\r\n * Used when starting a chat with more than one person\r\n *\r\n * @see OpenSingleChatRequest for use in a chat with only one person\r\n *\r\n * @beta\r\n */\r\nexport interface OpenGroupChatRequest extends OpenChatRequest {\r\n /**\r\n * Array containing Azure Active Directory UPNs (e-mail addresss) of users to open chat with\r\n */\r\n users: string[];\r\n /**\r\n * The display name of a conversation for 3 or more users (chats with fewer than three users will ignore this field)\r\n */\r\n topic?: string;\r\n}\r\n\r\n/**\r\n * Contains functionality to start chat with others\r\n *\r\n * @beta\r\n */\r\nexport namespace chat {\r\n /**\r\n * Allows the user to open a chat with a single user and allows\r\n * for the user to specify the message they wish to send.\r\n *\r\n * @param openChatRequest: {@link OpenSingleChatRequest}- a request object that contains a user's email as well as an optional message parameter.\r\n *\r\n * @returns Promise resolved upon completion\r\n */\r\n export function openChat(openChatRequest: OpenSingleChatRequest): Promise {\r\n return new Promise(resolve => {\r\n ensureInitialized(FrameContexts.content);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n if (runtime.isLegacyTeams) {\r\n resolve(\r\n sendAndHandleError(\r\n 'executeDeepLink',\r\n createTeamsDeepLinkForChat([openChatRequest.user], undefined /*topic*/, openChatRequest.message),\r\n ),\r\n );\r\n } else {\r\n const sendPromise = sendAndHandleError('chat.openChat', {\r\n members: openChatRequest.user,\r\n message: openChatRequest.message,\r\n });\r\n resolve(sendPromise);\r\n }\r\n });\r\n }\r\n /**\r\n * Allows the user to create a chat with multiple users (2+) and allows\r\n * for the user to specify a message and name the topic of the conversation. If\r\n * only 1 user is provided into users array default back to origin openChat.\r\n *\r\n * @param openChatRequest: {@link OpenGroupChatRequest} - a request object that contains a list of user emails as well as optional parameters for message and topic (display name for the group chat).\r\n *\r\n * @returns Promise resolved upon completion\r\n */\r\n export function openGroupChat(openChatRequest: OpenGroupChatRequest): Promise {\r\n return new Promise(resolve => {\r\n if (openChatRequest.users.length < 1) {\r\n throw Error('OpenGroupChat Failed: No users specified');\r\n }\r\n if (openChatRequest.users.length === 1) {\r\n const chatRequest: OpenSingleChatRequest = {\r\n user: openChatRequest.users[0],\r\n message: openChatRequest.message,\r\n };\r\n openChat(chatRequest);\r\n } else {\r\n ensureInitialized(FrameContexts.content);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n if (runtime.isLegacyTeams) {\r\n resolve(\r\n sendAndHandleError(\r\n 'executeDeepLink',\r\n createTeamsDeepLinkForChat(openChatRequest.users, openChatRequest.topic, openChatRequest.message),\r\n ),\r\n );\r\n } else {\r\n const sendPromise = sendAndHandleError('chat.openChat', {\r\n members: openChatRequest.users,\r\n message: openChatRequest.message,\r\n topic: openChatRequest.topic,\r\n });\r\n resolve(sendPromise);\r\n }\r\n }\r\n });\r\n }\r\n\r\n export function isSupported(): boolean {\r\n return runtime.supports.chat ? true : false;\r\n }\r\n}\r\n","import { teamsDeepLinkHost, teamsDeepLinkProtocol } from './constants';\r\nimport {\r\n teamsDeepLinkAttendeesUrlParameterName,\r\n teamsDeepLinkContentUrlParameterName,\r\n teamsDeepLinkEndTimeUrlParameterName,\r\n teamsDeepLinkMessageUrlParameterName,\r\n teamsDeepLinkSourceUrlParameterName,\r\n teamsDeepLinkStartTimeUrlParameterName,\r\n teamsDeepLinkSubjectUrlParameterName,\r\n teamsDeepLinkTopicUrlParameterName,\r\n teamsDeepLinkUrlPathForAppInstall,\r\n teamsDeepLinkUrlPathForCalendar,\r\n teamsDeepLinkUrlPathForCall,\r\n teamsDeepLinkUrlPathForChat,\r\n teamsDeepLinkUsersUrlParameterName,\r\n teamsDeepLinkWithVideoUrlParameterName,\r\n} from './deepLinkConstants';\r\n\r\nexport function createTeamsDeepLinkForChat(users: string[], topic?: string, message?: string): string {\r\n if (users.length === 0) {\r\n throw new Error('Must have at least one user when creating a chat deep link');\r\n }\r\n\r\n const usersSearchParameter =\r\n `${teamsDeepLinkUsersUrlParameterName}=` + users.map(user => encodeURIComponent(user)).join(',');\r\n const topicSearchParameter =\r\n topic === undefined ? '' : `&${teamsDeepLinkTopicUrlParameterName}=${encodeURIComponent(topic)}`;\r\n const messageSearchParameter =\r\n message === undefined ? '' : `&${teamsDeepLinkMessageUrlParameterName}=${encodeURIComponent(message)}`;\r\n\r\n return `${teamsDeepLinkProtocol}://${teamsDeepLinkHost}${teamsDeepLinkUrlPathForChat}?${usersSearchParameter}${topicSearchParameter}${messageSearchParameter}`;\r\n}\r\n\r\nexport function createTeamsDeepLinkForCall(targets: string[], withVideo?: boolean, source?: string): string {\r\n if (targets.length === 0) {\r\n throw new Error('Must have at least one target when creating a call deep link');\r\n }\r\n const usersSearchParameter =\r\n `${teamsDeepLinkUsersUrlParameterName}=` + targets.map(user => encodeURIComponent(user)).join(',');\r\n const withVideoSearchParameter =\r\n withVideo === undefined ? '' : `&${teamsDeepLinkWithVideoUrlParameterName}=${encodeURIComponent(withVideo)}`;\r\n const sourceSearchParameter =\r\n source === undefined ? '' : `&${teamsDeepLinkSourceUrlParameterName}=${encodeURIComponent(source)}`;\r\n\r\n return `${teamsDeepLinkProtocol}://${teamsDeepLinkHost}${teamsDeepLinkUrlPathForCall}?${usersSearchParameter}${withVideoSearchParameter}${sourceSearchParameter}`;\r\n}\r\n\r\nexport function createTeamsDeepLinkForCalendar(\r\n attendees?: string[],\r\n startTime?: string,\r\n endTime?: string,\r\n subject?: string,\r\n content?: string,\r\n): string {\r\n const attendeeSearchParameter =\r\n attendees === undefined\r\n ? ''\r\n : `${teamsDeepLinkAttendeesUrlParameterName}=` +\r\n attendees.map(attendee => encodeURIComponent(attendee)).join(',');\r\n const startTimeSearchParameter =\r\n startTime === undefined ? '' : `&${teamsDeepLinkStartTimeUrlParameterName}=${encodeURIComponent(startTime)}`;\r\n const endTimeSearchParameter =\r\n endTime === undefined ? '' : `&${teamsDeepLinkEndTimeUrlParameterName}=${encodeURIComponent(endTime)}`;\r\n const subjectSearchParameter =\r\n subject === undefined ? '' : `&${teamsDeepLinkSubjectUrlParameterName}=${encodeURIComponent(subject)}`;\r\n const contentSearchParameter =\r\n content === undefined ? '' : `&${teamsDeepLinkContentUrlParameterName}=${encodeURIComponent(content)}`;\r\n\r\n return `${teamsDeepLinkProtocol}://${teamsDeepLinkHost}${teamsDeepLinkUrlPathForCalendar}?${attendeeSearchParameter}${startTimeSearchParameter}${endTimeSearchParameter}${subjectSearchParameter}${contentSearchParameter}`;\r\n}\r\n\r\nexport function createTeamsDeepLinkForAppInstallDialog(appId: string): string {\r\n if (!appId) {\r\n throw new Error('App ID must be set when creating an app install dialog deep link');\r\n }\r\n return `${teamsDeepLinkProtocol}://${teamsDeepLinkHost}${teamsDeepLinkUrlPathForAppInstall}${encodeURIComponent(\r\n appId,\r\n )}/`;\r\n}\r\n","/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\r\n/* eslint-disable @typescript-eslint/no-explicit-any */\r\n/* eslint-disable @typescript-eslint/ban-types */\r\n\r\nimport { sendMessageToParent } from '../internal/communication';\r\nimport { registerHandler } from '../internal/handlers';\r\nimport { ensureInitialized } from '../internal/internalAPIs';\r\nimport { getGenericOnCompleteHandler } from '../internal/utils';\r\nimport { FrameContexts } from './constants';\r\n\r\nexport interface IAppWindow {\r\n /**\r\n * Send a message to the AppWindow.\r\n *\r\n * @param message - The message to send\r\n * @param onComplete - The callback to know if the postMessage has been success/failed.\r\n */\r\n postMessage(message: any, onComplete?: (status: boolean, reason?: string) => void): void;\r\n\r\n /**\r\n * Add a listener that will be called when an event is received from this AppWindow.\r\n *\r\n * @param type - The event to listen to. Currently the only supported type is 'message'.\r\n * @param listener - The listener that will be called\r\n */\r\n addEventListener(type: string, listener: Function): void;\r\n}\r\n\r\nexport class ChildAppWindow implements IAppWindow {\r\n /**\r\n * Send a message to the ChildAppWindow.\r\n *\r\n * @param message - The message to send\r\n * @param onComplete - The callback to know if the postMessage has been success/failed.\r\n */\r\n public postMessage(message: any, onComplete?: (status: boolean, reason?: string) => void): void {\r\n ensureInitialized();\r\n sendMessageToParent('messageForChild', [message], onComplete ? onComplete : getGenericOnCompleteHandler());\r\n }\r\n /**\r\n * Add a listener that will be called when an event is received from the ChildAppWindow.\r\n *\r\n * @param type - The event to listen to. Currently the only supported type is 'message'.\r\n * @param listener - The listener that will be called\r\n */\r\n public addEventListener(type: string, listener: (message: any) => void): void {\r\n ensureInitialized();\r\n if (type === 'message') {\r\n registerHandler('messageForParent', listener);\r\n }\r\n }\r\n}\r\n\r\nexport class ParentAppWindow implements IAppWindow {\r\n private static _instance: ParentAppWindow;\r\n public static get Instance(): IAppWindow {\r\n // Do you need arguments? Make it a regular method instead.\r\n return this._instance || (this._instance = new this());\r\n }\r\n\r\n /**\r\n * Send a message to the ParentAppWindow.\r\n *\r\n * @param message - The message to send\r\n * @param onComplete - The callback to know if the postMessage has been success/failed.\r\n */\r\n public postMessage(message: any, onComplete?: (status: boolean, reason?: string) => void): void {\r\n ensureInitialized(FrameContexts.task);\r\n sendMessageToParent('messageForParent', [message], onComplete ? onComplete : getGenericOnCompleteHandler());\r\n }\r\n\r\n /**\r\n * Add a listener that will be called when an event is received from the ParentAppWindow.\r\n *\r\n * @param type - The event to listen to. Currently the only supported type is 'message'.\r\n * @param listener - The listener that will be called\r\n */\r\n public addEventListener(type: string, listener: (message: any) => void): void {\r\n ensureInitialized(FrameContexts.task);\r\n if (type === 'message') {\r\n registerHandler('messageForChild', listener);\r\n }\r\n }\r\n}\r\n","import { media } from '../public/media';\r\nimport { people } from '../public/people';\r\nimport {\r\n imageOutputFormatsAPISupportVersion,\r\n nonFullScreenVideoModeAPISupportVersion,\r\n videoAndImageMediaAPISupportVersion,\r\n} from './constants';\r\nimport { throwExceptionIfMobileApiIsNotSupported } from './internalAPIs';\r\n\r\n/**\r\n * @hidden\r\n * Helper function to create a blob from media chunks based on their sequence\r\n *\r\n * @internal\r\n */\r\nexport function createFile(assembleAttachment: media.AssembleAttachment[], mimeType: string): Blob {\r\n if (assembleAttachment == null || mimeType == null || assembleAttachment.length <= 0) {\r\n return null;\r\n }\r\n let file: Blob;\r\n let sequence = 1;\r\n assembleAttachment.sort((a, b) => (a.sequence > b.sequence ? 1 : -1));\r\n assembleAttachment.forEach(item => {\r\n if (item.sequence == sequence) {\r\n if (file) {\r\n file = new Blob([file, item.file], { type: mimeType });\r\n } else {\r\n file = new Blob([item.file], { type: mimeType });\r\n }\r\n sequence++;\r\n }\r\n });\r\n return file;\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Helper function to convert Media chunks into another object type which can be later assemebled\r\n * Converts base 64 encoded string to byte array and then into an array of blobs\r\n *\r\n * @internal\r\n */\r\nexport function decodeAttachment(attachment: media.MediaChunk, mimeType: string): media.AssembleAttachment {\r\n if (attachment == null || mimeType == null) {\r\n return null;\r\n }\r\n const decoded = atob(attachment.chunk);\r\n const byteNumbers = new Array(decoded.length);\r\n for (let i = 0; i < decoded.length; i++) {\r\n byteNumbers[i] = decoded.charCodeAt(i);\r\n }\r\n const byteArray = new Uint8Array(byteNumbers);\r\n const blob: Blob = new Blob([byteArray], { type: mimeType });\r\n const assemble: media.AssembleAttachment = {\r\n sequence: attachment.chunkSequence,\r\n file: blob,\r\n };\r\n return assemble;\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Function throws an SdkError if the media call is not supported on current mobile version, else undefined.\r\n * @throws an SdkError if the media call is not supported\r\n * @internal\r\n */\r\nexport function throwExceptionIfMediaCallIsNotSupportedOnMobile(mediaInputs: media.MediaInputs): void {\r\n if (isMediaCallForVideoAndImageInputs(mediaInputs)) {\r\n throwExceptionIfMobileApiIsNotSupported(videoAndImageMediaAPISupportVersion);\r\n } else if (isMediaCallForNonFullScreenVideoMode(mediaInputs)) {\r\n throwExceptionIfMobileApiIsNotSupported(nonFullScreenVideoModeAPISupportVersion);\r\n } else if (isMediaCallForImageOutputFormats(mediaInputs)) {\r\n throwExceptionIfMobileApiIsNotSupported(imageOutputFormatsAPISupportVersion);\r\n }\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Function returns true if the app has registered to listen to video controller events, else false.\r\n *\r\n * @internal\r\n */\r\nexport function isVideoControllerRegistered(mediaInputs: media.MediaInputs): boolean {\r\n if (\r\n mediaInputs.mediaType == media.MediaType.Video &&\r\n mediaInputs.videoProps &&\r\n mediaInputs.videoProps.videoController\r\n ) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Returns true if the mediaInput params are valid and false otherwise\r\n *\r\n * @internal\r\n */\r\nexport function validateSelectMediaInputs(mediaInputs: media.MediaInputs): boolean {\r\n if (mediaInputs == null || mediaInputs.maxMediaCount > 10) {\r\n return false;\r\n }\r\n return true;\r\n}\r\n\r\n/**\r\n * Returns true if the mediaInput params are called for mediatype Image and contains Image outputs formats, false otherwise\r\n */\r\nexport function isMediaCallForImageOutputFormats(mediaInputs: media.MediaInputs): boolean {\r\n if (mediaInputs?.mediaType == media.MediaType.Image && mediaInputs?.imageProps?.imageOutputFormats) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Returns true if the mediaInput params are called for mediatype VideoAndImage and false otherwise\r\n *\r\n * @internal\r\n */\r\nexport function isMediaCallForVideoAndImageInputs(mediaInputs: media.MediaInputs): boolean {\r\n if (mediaInputs && (mediaInputs.mediaType == media.MediaType.VideoAndImage || mediaInputs.videoAndImageProps)) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Returns true if the mediaInput params are called for non-full screen video mode and false otherwise\r\n *\r\n * @internal\r\n */\r\nexport function isMediaCallForNonFullScreenVideoMode(mediaInputs: media.MediaInputs): boolean {\r\n if (\r\n mediaInputs &&\r\n mediaInputs.mediaType == media.MediaType.Video &&\r\n mediaInputs.videoProps &&\r\n !mediaInputs.videoProps.isFullScreenMode\r\n ) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Returns true if the get Media params are valid and false otherwise\r\n *\r\n * @internal\r\n */\r\nexport function validateGetMediaInputs(mimeType: string, format: media.FileFormat, content: string): boolean {\r\n if (mimeType == null || format == null || format != media.FileFormat.ID || content == null) {\r\n return false;\r\n }\r\n return true;\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Returns true if the view images param is valid and false otherwise\r\n *\r\n * @internal\r\n */\r\nexport function validateViewImagesInput(uriList: media.ImageUri[]): boolean {\r\n if (uriList == null || uriList.length <= 0 || uriList.length > 10) {\r\n return false;\r\n }\r\n return true;\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Returns true if the scan barcode param is valid and false otherwise\r\n *\r\n * @internal\r\n */\r\nexport function validateScanBarCodeInput(barCodeConfig: media.BarCodeConfig): boolean {\r\n if (barCodeConfig) {\r\n if (\r\n barCodeConfig.timeOutIntervalInSec === null ||\r\n barCodeConfig.timeOutIntervalInSec <= 0 ||\r\n barCodeConfig.timeOutIntervalInSec > 60\r\n ) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\n\r\n/**\r\n * @hidden\r\n * Returns true if the people picker params are valid and false otherwise\r\n *\r\n * @internal\r\n */\r\nexport function validatePeoplePickerInput(peoplePickerInputs: people.PeoplePickerInputs): boolean {\r\n if (peoplePickerInputs) {\r\n if (peoplePickerInputs.title) {\r\n if (typeof peoplePickerInputs.title !== 'string') {\r\n return false;\r\n }\r\n }\r\n\r\n if (peoplePickerInputs.setSelected) {\r\n if (typeof peoplePickerInputs.setSelected !== 'object') {\r\n return false;\r\n }\r\n }\r\n\r\n if (peoplePickerInputs.openOrgWideSearchInChatOrChannel) {\r\n if (typeof peoplePickerInputs.openOrgWideSearchInChatOrChannel !== 'boolean') {\r\n return false;\r\n }\r\n }\r\n if (peoplePickerInputs.singleSelect) {\r\n if (typeof peoplePickerInputs.singleSelect !== 'boolean') {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n}\r\n","/* eslint-disable @typescript-eslint/explicit-member-accessibility */\r\n\r\nimport { sendMessageToParent } from '../internal/communication';\r\nimport {\r\n captureImageMobileSupportVersion,\r\n getMediaCallbackSupportVersion,\r\n mediaAPISupportVersion,\r\n nonFullScreenVideoModeAPISupportVersion,\r\n scanBarCodeAPIMobileSupportVersion,\r\n} from '../internal/constants';\r\nimport { GlobalVars } from '../internal/globalVars';\r\nimport { registerHandler, removeHandler } from '../internal/handlers';\r\nimport {\r\n ensureInitialized,\r\n isCurrentSDKVersionAtLeast,\r\n throwExceptionIfMobileApiIsNotSupported,\r\n} from '../internal/internalAPIs';\r\nimport {\r\n createFile,\r\n decodeAttachment,\r\n isVideoControllerRegistered,\r\n throwExceptionIfMediaCallIsNotSupportedOnMobile,\r\n validateGetMediaInputs,\r\n validateScanBarCodeInput,\r\n validateSelectMediaInputs,\r\n validateViewImagesInput,\r\n} from '../internal/mediaUtil';\r\nimport { generateGUID } from '../internal/utils';\r\nimport { FrameContexts, HostClientType } from './constants';\r\nimport { ErrorCode, SdkError } from './interfaces';\r\n\r\nexport namespace media {\r\n /**\r\n * Enum for file formats supported\r\n */\r\n export enum FileFormat {\r\n Base64 = 'base64',\r\n ID = 'id',\r\n }\r\n\r\n /**\r\n * File object that can be used to represent image or video or audio\r\n */\r\n export class File {\r\n /**\r\n * Content of the file. When format is Base64, this is the base64 content\r\n * When format is ID, this is id mapping to the URI\r\n * When format is base64 and app needs to use this directly in HTML tags, it should convert this to dataUrl.\r\n */\r\n public content: string;\r\n\r\n /**\r\n * Format of the content\r\n */\r\n public format: FileFormat;\r\n\r\n /**\r\n * Size of the file in KB\r\n */\r\n public size: number;\r\n\r\n /**\r\n * MIME type. This can be used for constructing a dataUrl, if needed.\r\n */\r\n public mimeType: string;\r\n\r\n /**\r\n * Optional: Name of the file\r\n */\r\n public name?: string;\r\n }\r\n\r\n /**\r\n * Launch camera, capture image or choose image from gallery and return the images as a File[] object to the callback.\r\n *\r\n * @params callback - Callback will be called with an @see SdkError if there are any.\r\n * If error is null or undefined, the callback will be called with a collection of @see File objects\r\n * @remarks\r\n * Note: Currently we support getting one File through this API, i.e. the file arrays size will be one.\r\n * Note: For desktop, this API is not supported. Callback will be resolved with ErrorCode.NotSupported.\r\n *\r\n */\r\n export function captureImage(callback: (error: SdkError, files: File[]) => void): void {\r\n if (!callback) {\r\n throw new Error('[captureImage] Callback cannot be null');\r\n }\r\n ensureInitialized(FrameContexts.content, FrameContexts.task);\r\n\r\n if (!GlobalVars.isFramelessWindow) {\r\n const notSupportedError: SdkError = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };\r\n callback(notSupportedError, undefined);\r\n return;\r\n }\r\n\r\n if (!isCurrentSDKVersionAtLeast(captureImageMobileSupportVersion)) {\r\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\r\n callback(oldPlatformError, undefined);\r\n return;\r\n }\r\n\r\n sendMessageToParent('captureImage', callback);\r\n }\r\n\r\n /**\r\n * Media object returned by the select Media API\r\n */\r\n export class Media extends File {\r\n constructor(that: Media = null) {\r\n super();\r\n if (that) {\r\n this.content = that.content;\r\n this.format = that.format;\r\n this.mimeType = that.mimeType;\r\n this.name = that.name;\r\n this.preview = that.preview;\r\n this.size = that.size;\r\n }\r\n }\r\n\r\n /**\r\n * A preview of the file which is a lightweight representation.\r\n * In case of images this will be a thumbnail/compressed image in base64 encoding.\r\n */\r\n public preview: string;\r\n\r\n /**\r\n * Gets the media in chunks irrespective of size, these chunks are assembled and sent back to the webapp as file/blob\r\n * @param callback - callback is called with the @see SdkError if there is an error\r\n * If error is null or undefined, the callback will be called with @see Blob.\r\n */\r\n public getMedia(callback: (error: SdkError, blob: Blob) => void): void {\r\n if (!callback) {\r\n throw new Error('[get Media] Callback cannot be null');\r\n }\r\n ensureInitialized(FrameContexts.content, FrameContexts.task);\r\n if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {\r\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\r\n callback(oldPlatformError, null);\r\n return;\r\n }\r\n if (!validateGetMediaInputs(this.mimeType, this.format, this.content)) {\r\n const invalidInput: SdkError = { errorCode: ErrorCode.INVALID_ARGUMENTS };\r\n callback(invalidInput, null);\r\n return;\r\n }\r\n // Call the new get media implementation via callbacks if the client version is greater than or equal to '2.0.0'\r\n if (isCurrentSDKVersionAtLeast(getMediaCallbackSupportVersion)) {\r\n this.getMediaViaCallback(callback);\r\n } else {\r\n this.getMediaViaHandler(callback);\r\n }\r\n }\r\n\r\n private getMediaViaCallback(callback: (error: SdkError, blob: Blob) => void): void {\r\n const helper: MediaHelper = {\r\n mediaMimeType: this.mimeType,\r\n assembleAttachment: [],\r\n };\r\n const localUriId = [this.content];\r\n function handleGetMediaCallbackRequest(mediaResult: MediaResult): void {\r\n if (callback) {\r\n if (mediaResult && mediaResult.error) {\r\n callback(mediaResult.error, null);\r\n } else {\r\n if (mediaResult && mediaResult.mediaChunk) {\r\n // If the chunksequence number is less than equal to 0 implies EOF\r\n // create file/blob when all chunks have arrived and we get 0/-1 as chunksequence number\r\n if (mediaResult.mediaChunk.chunkSequence <= 0) {\r\n const file = createFile(helper.assembleAttachment, helper.mediaMimeType);\r\n callback(mediaResult.error, file);\r\n } else {\r\n // Keep pushing chunks into assemble attachment\r\n const assemble: AssembleAttachment = decodeAttachment(mediaResult.mediaChunk, helper.mediaMimeType);\r\n helper.assembleAttachment.push(assemble);\r\n }\r\n } else {\r\n callback({ errorCode: ErrorCode.INTERNAL_ERROR, message: 'data received is null' }, null);\r\n }\r\n }\r\n }\r\n }\r\n sendMessageToParent('getMedia', localUriId, handleGetMediaCallbackRequest);\r\n }\r\n\r\n private getMediaViaHandler(callback: (error: SdkError, blob: Blob) => void): void {\r\n const actionName = generateGUID();\r\n const helper: MediaHelper = {\r\n mediaMimeType: this.mimeType,\r\n assembleAttachment: [],\r\n };\r\n const params = [actionName, this.content];\r\n this.content && callback && sendMessageToParent('getMedia', params);\r\n function handleGetMediaRequest(response: string): void {\r\n if (callback) {\r\n const mediaResult: MediaResult = JSON.parse(response);\r\n if (mediaResult.error) {\r\n callback(mediaResult.error, null);\r\n removeHandler('getMedia' + actionName);\r\n } else {\r\n if (mediaResult.mediaChunk) {\r\n // If the chunksequence number is less than equal to 0 implies EOF\r\n // create file/blob when all chunks have arrived and we get 0/-1 as chunksequence number\r\n if (mediaResult.mediaChunk.chunkSequence <= 0) {\r\n const file = createFile(helper.assembleAttachment, helper.mediaMimeType);\r\n callback(mediaResult.error, file);\r\n removeHandler('getMedia' + actionName);\r\n } else {\r\n // Keep pushing chunks into assemble attachment\r\n const assemble: AssembleAttachment = decodeAttachment(mediaResult.mediaChunk, helper.mediaMimeType);\r\n helper.assembleAttachment.push(assemble);\r\n }\r\n } else {\r\n callback({ errorCode: ErrorCode.INTERNAL_ERROR, message: 'data received is null' }, null);\r\n removeHandler('getMedia' + actionName);\r\n }\r\n }\r\n }\r\n }\r\n\r\n registerHandler('getMedia' + actionName, handleGetMediaRequest);\r\n }\r\n }\r\n\r\n /**\r\n * Input parameter supplied to the select Media API\r\n */\r\n export interface MediaInputs {\r\n /**\r\n * Only one media type can be selected at a time\r\n */\r\n mediaType: MediaType;\r\n\r\n /**\r\n * max limit of media allowed to be selected in one go, current max limit is 10 set by office lens.\r\n */\r\n maxMediaCount: number;\r\n\r\n /**\r\n * Additional properties for customization of select media - Image in mobile devices\r\n */\r\n imageProps?: ImageProps;\r\n\r\n /**\r\n * Additional properties for customization of select media - Video in mobile devices\r\n */\r\n videoProps?: VideoProps;\r\n\r\n /**\r\n * Additional properties for customization of select media - VideoAndImage in mobile devices\r\n */\r\n videoAndImageProps?: VideoAndImageProps;\r\n\r\n /**\r\n * Additional properties for audio capture flows.\r\n */\r\n audioProps?: AudioProps;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * --------\r\n * All properties common to Image and Video Props\r\n */\r\n interface MediaProps {\r\n /**\r\n * @hidden\r\n * Optional; Lets the developer specify the media source, more than one can be specified.\r\n * Default value is both camera and gallery\r\n */\r\n sources?: Source[];\r\n\r\n /**\r\n * @hidden\r\n * Optional; Specify in which mode the camera will be opened.\r\n * Default value is Photo\r\n */\r\n startMode?: CameraStartMode;\r\n\r\n /**\r\n * @hidden\r\n * Optional; indicate if user is allowed to move between front and back camera\r\n * Default value is true\r\n */\r\n cameraSwitcher?: boolean;\r\n }\r\n\r\n /**\r\n * All properties in ImageProps are optional and have default values in the platform\r\n */\r\n export interface ImageProps extends MediaProps {\r\n /**\r\n * Optional; indicate if inking on the selected Image is allowed or not\r\n * Default value is true\r\n */\r\n ink?: boolean;\r\n\r\n /**\r\n * Optional; indicate if putting text stickers on the selected Image is allowed or not\r\n * Default value is true\r\n */\r\n textSticker?: boolean;\r\n\r\n /**\r\n * Optional; indicate if image filtering mode is enabled on the selected image\r\n * Default value is false\r\n */\r\n enableFilter?: boolean;\r\n\r\n /**\r\n * Optional; Lets the developer specify the image output formats, more than one can be specified.\r\n * Default value is Image.\r\n */\r\n imageOutputFormats?: ImageOutputFormats[];\r\n }\r\n\r\n /**\r\n * All properties in VideoProps are optional and have default values in the platform\r\n */\r\n export interface VideoProps extends MediaProps {\r\n /**\r\n * Optional; the maximum duration in seconds after which the recording should terminate automatically.\r\n * Default value is defined by the platform serving the API.\r\n */\r\n maxDuration?: number;\r\n\r\n /**\r\n * Optional; to determine if the video capturing flow needs to be launched\r\n * in Full Screen Mode (Lens implementation) or PictureInPicture Mode (Native implementation).\r\n * Default value is true, indicating video will always launch in Full Screen Mode via lens.\r\n */\r\n isFullScreenMode?: boolean;\r\n\r\n /**\r\n * Optional; controls the visibility of stop button in PictureInPicture Mode.\r\n * Default value is true, indicating the user will be able to stop the video.\r\n */\r\n isStopButtonVisible?: boolean;\r\n\r\n /**\r\n * Optional; setting VideoController will register your app to listen to the lifecycle events during the video capture flow.\r\n * Your app can also dynamically control the experience while capturing the video by notifying the host client.\r\n */\r\n videoController?: VideoController;\r\n }\r\n\r\n /**\r\n * All properties in VideoAndImageProps are optional and have default values in the platform\r\n */\r\n export interface VideoAndImageProps extends ImageProps, VideoProps {}\r\n\r\n /**\r\n * All properties in AudioProps are optional and have default values in the platform\r\n */\r\n export interface AudioProps {\r\n /**\r\n * Optional; the maximum duration in minutes after which the recording should terminate automatically\r\n * Default value is defined by the platform serving the API.\r\n */\r\n maxDuration?: number;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * --------\r\n * Base class which holds the callback and notifies events to the host client\r\n */\r\n abstract class MediaController {\r\n protected controllerCallback: T;\r\n\r\n public constructor(controllerCallback?: T) {\r\n this.controllerCallback = controllerCallback;\r\n }\r\n\r\n protected abstract getMediaType(): MediaType;\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * --------\r\n * This function will be implemented by the respective media class which holds the logic\r\n * of specific events that needs to be notified to the app.\r\n * @param mediaEvent indicates the event signed by the host client to the app\r\n */\r\n protected abstract notifyEventToApp(mediaEvent: MediaControllerEvent): void;\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * --------\r\n * Function to notify the host client to programatically control the experience\r\n * @param mediaEvent indicates what the event that needs to be signaled to the host client\r\n * Optional; @param callback is used to send app if host client has successfully handled the notification event or not\r\n */\r\n protected notifyEventToHost(mediaEvent: MediaControllerEvent, callback?: (err?: SdkError) => void): void {\r\n ensureInitialized(FrameContexts.content, FrameContexts.task);\r\n\r\n try {\r\n throwExceptionIfMobileApiIsNotSupported(nonFullScreenVideoModeAPISupportVersion);\r\n } catch (err) {\r\n if (callback) {\r\n callback(err);\r\n }\r\n return;\r\n }\r\n\r\n const params: MediaControllerParam = { mediaType: this.getMediaType(), mediaControllerEvent: mediaEvent };\r\n sendMessageToParent('media.controller', [params], (err?: SdkError) => {\r\n if (callback) {\r\n callback(err);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Function to programatically stop the ongoing media event\r\n * Optional; @param callback is used to send app if host client has successfully stopped the event or not\r\n */\r\n public stop(callback?: (err?: SdkError) => void): void {\r\n this.notifyEventToHost(MediaControllerEvent.StopRecording, callback);\r\n }\r\n }\r\n\r\n /**\r\n * Callback which will register your app to listen to lifecycle events during the video capture flow\r\n */\r\n export interface VideoControllerCallback {\r\n onRecordingStarted?(): void;\r\n }\r\n\r\n /**\r\n * VideoController class is used to communicate between the app and the host client during the video capture flow\r\n */\r\n export class VideoController extends MediaController {\r\n protected getMediaType(): MediaType {\r\n return MediaType.Video;\r\n }\r\n\r\n public notifyEventToApp(mediaEvent: MediaControllerEvent): void {\r\n if (!this.controllerCallback) {\r\n // Early return as app has not registered with the callback\r\n return;\r\n }\r\n\r\n switch (mediaEvent) {\r\n case MediaControllerEvent.StartRecording:\r\n if (this.controllerCallback.onRecordingStarted) {\r\n this.controllerCallback.onRecordingStarted();\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * --------\r\n * Events which are used to communicate between the app and the host client during the media recording flow\r\n */\r\n export enum MediaControllerEvent {\r\n StartRecording = 1,\r\n StopRecording = 2,\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * --------\r\n * Interface with relevant info to send communication from the app to the host client\r\n */\r\n interface MediaControllerParam {\r\n /**\r\n * List of team information\r\n */\r\n mediaType: media.MediaType;\r\n\r\n /**\r\n * List of team information\r\n */\r\n mediaControllerEvent: MediaControllerEvent;\r\n }\r\n\r\n /**\r\n * The modes in which camera can be launched in select Media API\r\n */\r\n export enum CameraStartMode {\r\n Photo = 1,\r\n Document = 2,\r\n Whiteboard = 3,\r\n BusinessCard = 4,\r\n }\r\n\r\n /**\r\n * Specifies the image source\r\n */\r\n export enum Source {\r\n Camera = 1,\r\n Gallery = 2,\r\n }\r\n\r\n /**\r\n * Specifies the type of Media\r\n */\r\n export enum MediaType {\r\n Image = 1,\r\n Video = 2,\r\n VideoAndImage = 3,\r\n Audio = 4,\r\n }\r\n\r\n /**\r\n * Input for view images API\r\n */\r\n export interface ImageUri {\r\n value: string;\r\n type: ImageUriType;\r\n }\r\n\r\n /**\r\n * ID contains a mapping for content uri on platform's side, URL is generic\r\n */\r\n export enum ImageUriType {\r\n ID = 1,\r\n URL = 2,\r\n }\r\n\r\n /**\r\n * Specifies the image output formats.\r\n */\r\n export enum ImageOutputFormats {\r\n IMAGE = 1,\r\n PDF = 2,\r\n }\r\n\r\n /**\r\n * Media chunks an output of getMedia API from platform\r\n */\r\n export interface MediaChunk {\r\n /**\r\n * Base 64 data for the requested uri\r\n */\r\n chunk: string;\r\n\r\n /**\r\n * chunk sequence number\r\n */\r\n chunkSequence: number;\r\n }\r\n\r\n /**\r\n * Output of getMedia API from platform\r\n */\r\n export interface MediaResult {\r\n /**\r\n * error encountered in getMedia API\r\n */\r\n error: SdkError;\r\n\r\n /**\r\n * Media chunk which will be assemebled and converted into a blob\r\n */\r\n mediaChunk: MediaChunk;\r\n }\r\n\r\n /**\r\n * Helper object to assembled media chunks\r\n */\r\n export interface AssembleAttachment {\r\n sequence: number;\r\n file: Blob;\r\n }\r\n\r\n /**\r\n * Helper class for assembling media\r\n */\r\n interface MediaHelper {\r\n mediaMimeType: string;\r\n assembleAttachment: AssembleAttachment[];\r\n }\r\n\r\n /**\r\n * Select an attachment using camera/gallery\r\n *\r\n * @param mediaInputs - The input params to customize the media to be selected\r\n * @param callback - The callback to invoke after fetching the media\r\n */\r\n export function selectMedia(\r\n mediaInputs: MediaInputs,\r\n callback: (error: SdkError, attachments: Media[]) => void,\r\n ): void {\r\n if (!callback) {\r\n throw new Error('[select Media] Callback cannot be null');\r\n }\r\n\r\n ensureInitialized(FrameContexts.content, FrameContexts.task);\r\n if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {\r\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\r\n callback(oldPlatformError, null);\r\n return;\r\n }\r\n\r\n try {\r\n throwExceptionIfMediaCallIsNotSupportedOnMobile(mediaInputs);\r\n } catch (err) {\r\n callback(err, null);\r\n return;\r\n }\r\n\r\n if (!validateSelectMediaInputs(mediaInputs)) {\r\n const invalidInput: SdkError = { errorCode: ErrorCode.INVALID_ARGUMENTS };\r\n callback(invalidInput, null);\r\n return;\r\n }\r\n\r\n const params = [mediaInputs];\r\n // What comes back from native as attachments would just be objects and will be missing getMedia method on them\r\n sendMessageToParent(\r\n 'selectMedia',\r\n params,\r\n (err: SdkError, localAttachments?: Media[], mediaEvent?: MediaControllerEvent) => {\r\n // MediaControllerEvent response is used to notify the app about events and is a partial response to selectMedia\r\n if (mediaEvent) {\r\n if (isVideoControllerRegistered(mediaInputs)) {\r\n mediaInputs.videoProps.videoController.notifyEventToApp(mediaEvent);\r\n }\r\n return;\r\n }\r\n\r\n // Media Attachments are final response to selectMedia\r\n if (!localAttachments) {\r\n callback(err, null);\r\n return;\r\n }\r\n\r\n const mediaArray: Media[] = [];\r\n for (const attachment of localAttachments) {\r\n mediaArray.push(new Media(attachment));\r\n }\r\n callback(err, mediaArray);\r\n },\r\n );\r\n }\r\n\r\n /**\r\n * View images using native image viewer\r\n *\r\n * @param uriList - list of URIs for images to be viewed - can be content URI or server URL. Supports up to 10 Images in a single call\r\n * @param callback - returns back error if encountered, returns null in case of success\r\n */\r\n export function viewImages(uriList: ImageUri[], callback: (error?: SdkError) => void): void {\r\n if (!callback) {\r\n throw new Error('[view images] Callback cannot be null');\r\n }\r\n ensureInitialized(FrameContexts.content, FrameContexts.task);\r\n\r\n if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {\r\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\r\n callback(oldPlatformError);\r\n return;\r\n }\r\n if (!validateViewImagesInput(uriList)) {\r\n const invalidInput: SdkError = { errorCode: ErrorCode.INVALID_ARGUMENTS };\r\n callback(invalidInput);\r\n return;\r\n }\r\n\r\n const params = [uriList];\r\n sendMessageToParent('viewImages', params, callback);\r\n }\r\n\r\n /**\r\n * Barcode configuration supplied to scanBarCode API to customize barcode scanning experience in mobile\r\n * All properties in BarCodeConfig are optional and have default values in the platform\r\n */\r\n export interface BarCodeConfig {\r\n /**\r\n * Optional; Lets the developer specify the scan timeout interval in seconds\r\n * Default value is 30 seconds and max allowed value is 60 seconds\r\n */\r\n timeOutIntervalInSec?: number;\r\n }\r\n\r\n /**\r\n * Scan Barcode/QRcode using camera\r\n *\r\n * @remarks\r\n * Note: For desktop and web, this API is not supported. Callback will be resolved with ErrorCode.NotSupported.\r\n *\r\n * @param callback - callback to invoke after scanning the barcode\r\n * @param config - optional input configuration to customize the barcode scanning experience\r\n */\r\n export function scanBarCode(callback: (error: SdkError, decodedText: string) => void, config?: BarCodeConfig): void {\r\n if (!callback) {\r\n throw new Error('[media.scanBarCode] Callback cannot be null');\r\n }\r\n ensureInitialized(FrameContexts.content, FrameContexts.task);\r\n\r\n if (\r\n GlobalVars.hostClientType === HostClientType.desktop ||\r\n GlobalVars.hostClientType === HostClientType.web ||\r\n GlobalVars.hostClientType === HostClientType.rigel ||\r\n GlobalVars.hostClientType === HostClientType.teamsRoomsWindows ||\r\n GlobalVars.hostClientType === HostClientType.teamsRoomsAndroid ||\r\n GlobalVars.hostClientType === HostClientType.teamsPhones ||\r\n GlobalVars.hostClientType === HostClientType.teamsDisplays\r\n ) {\r\n const notSupportedError: SdkError = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };\r\n callback(notSupportedError, null);\r\n return;\r\n }\r\n\r\n if (!isCurrentSDKVersionAtLeast(scanBarCodeAPIMobileSupportVersion)) {\r\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\r\n callback(oldPlatformError, null);\r\n return;\r\n }\r\n\r\n if (!validateScanBarCodeInput(config)) {\r\n const invalidInput: SdkError = { errorCode: ErrorCode.INVALID_ARGUMENTS };\r\n callback(invalidInput, null);\r\n return;\r\n }\r\n\r\n sendMessageToParent('media.scanBarCode', [config], callback);\r\n }\r\n}\r\n","import { sendAndHandleSdkError as sendAndHandleError } from '../internal/communication';\r\nimport { locationAPIsRequiredVersion } from '../internal/constants';\r\nimport { ensureInitialized, isCurrentSDKVersionAtLeast } from '../internal/internalAPIs';\r\nimport {\r\n callCallbackWithErrorOrBooleanFromPromiseAndReturnPromise,\r\n callCallbackWithErrorOrResultFromPromiseAndReturnPromise,\r\n} from '../internal/utils';\r\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\r\nimport { ErrorCode, SdkError } from './interfaces';\r\nimport { runtime } from './runtime';\r\n\r\nexport namespace location {\r\n export interface LocationProps {\r\n /**\r\n whether user can alter location or not\r\n if false, user will be shown current location \r\n and wouldn't be allowed to alter it\r\n */\r\n allowChooseLocation: boolean;\r\n /**\r\n whether selected location should be shown to user on map or not.\r\n If allowChooseLocation is true, this parameter will be ignored by platform.\r\n If allowChooseLocation is false, and this parameter is not provided, default \r\n value will be false.\r\n */\r\n showMap?: boolean;\r\n }\r\n\r\n export interface Location {\r\n /**\r\n Latitude of the location\r\n */\r\n latitude: number;\r\n /**\r\n Longitude of the location\r\n */\r\n longitude: number;\r\n /**\r\n Accuracy of the coordinates captured\r\n */\r\n accuracy?: number;\r\n /**\r\n Time stamp when the location was captured\r\n */\r\n timestamp?: number;\r\n }\r\n\r\n /**\r\n * Fetches current user coordinates or allows user to choose location on map\r\n *\r\n * @param props {@link LocationProps} - Specifying how the location request is handled\r\n * @returns Promise that will be fulfilled when the operation has completed\r\n */\r\n export function getLocation(props: LocationProps): Promise;\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link location.getLocation location.getLocation(props: LocationProps): Promise\\} instead.\r\n * @param props {@link LocationProps} - Specifying how the location request is handled\r\n * @param callback - Callback to invoke when current user location is fetched\r\n */\r\n export function getLocation(props: LocationProps, callback: (error: SdkError, location: Location) => void): void;\r\n export function getLocation(\r\n props: LocationProps,\r\n callback?: (error: SdkError, location: Location) => void,\r\n ): Promise {\r\n ensureInitialized(FrameContexts.content, FrameContexts.task);\r\n\r\n return callCallbackWithErrorOrResultFromPromiseAndReturnPromise(getLocationHelper, callback, props);\r\n }\r\n\r\n function getLocationHelper(props: LocationProps): Promise {\r\n return new Promise(resolve => {\r\n if (!isCurrentSDKVersionAtLeast(locationAPIsRequiredVersion)) {\r\n throw { errorCode: ErrorCode.OLD_PLATFORM };\r\n }\r\n if (!props) {\r\n throw { errorCode: ErrorCode.INVALID_ARGUMENTS };\r\n }\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n resolve(sendAndHandleError('location.getLocation', props));\r\n });\r\n }\r\n\r\n /**\r\n * Shows the location on map corresponding to the given coordinates\r\n *\r\n * @param location {@link Location} - which needs to be shown on map\r\n * @returns Promise that will be fulfilled when the operation has completed\r\n */\r\n export function showLocation(location: Location): Promise;\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link location.showLocation location.showLocation(location: Location): Promise\\} instead.\r\n * Shows the location on map corresponding to the given coordinates\r\n * @param location {@link Location} - which needs to be shown on map\r\n * @param callback - Callback to invoke when the location is opened on map\r\n */\r\n export function showLocation(location: Location, callback: (error: SdkError, status: boolean) => void): void;\r\n export function showLocation(\r\n location: Location,\r\n callback?: (error: SdkError, status: boolean) => void,\r\n ): Promise {\r\n ensureInitialized(FrameContexts.content, FrameContexts.task);\r\n return callCallbackWithErrorOrBooleanFromPromiseAndReturnPromise(showLocationHelper, callback, location);\r\n }\r\n\r\n export function showLocationHelper(location: Location): Promise {\r\n return new Promise(resolve => {\r\n if (!isCurrentSDKVersionAtLeast(locationAPIsRequiredVersion)) {\r\n throw { errorCode: ErrorCode.OLD_PLATFORM };\r\n }\r\n if (!location) {\r\n throw { errorCode: ErrorCode.INVALID_ARGUMENTS };\r\n }\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n resolve(sendAndHandleError('location.showLocation', location));\r\n });\r\n }\r\n\r\n export function isSupported(): boolean {\r\n return runtime.supports.location ? true : false;\r\n }\r\n}\r\n","import { sendMessageToParent } from '../internal/communication';\r\nimport { registerHandler } from '../internal/handlers';\r\nimport { ensureInitialized } from '../internal/internalAPIs';\r\nimport { FrameContexts } from './constants';\r\nimport { SdkError } from './interfaces';\r\n\r\nexport namespace meeting {\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * Data structure to represent a meeting details\r\n *\r\n * @internal\r\n */\r\n export interface IMeetingDetailsResponse {\r\n /**\r\n * @hidden\r\n * details object\r\n */\r\n details: IMeetingDetails | ICallDetails;\r\n\r\n /**\r\n * @hidden\r\n * conversation object\r\n */\r\n conversation: IConversation;\r\n\r\n /**\r\n * @hidden\r\n * organizer object\r\n */\r\n organizer: IOrganizer;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * Base data structure to represent a meeting or call detail\r\n */\r\n export interface IMeetingOrCallDetailsBase {\r\n /**\r\n * @hidden\r\n * Scheduled start time of the meeting or start time of the call\r\n */\r\n scheduledStartTime: string;\r\n\r\n /**\r\n * @hidden\r\n * url to join the current meeting or call\r\n */\r\n joinUrl?: string;\r\n\r\n /**\r\n * @hidden\r\n * type of the meeting or call\r\n */\r\n type?: T;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * Data structure to represent call details\r\n */\r\n export type ICallDetails = IMeetingOrCallDetailsBase;\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * Data structure to represent meeting details.\r\n */\r\n export interface IMeetingDetails extends IMeetingOrCallDetailsBase {\r\n /**\r\n * @hidden\r\n * Scheduled end time of the meeting\r\n */\r\n scheduledEndTime: string;\r\n\r\n /**\r\n * @hidden\r\n * meeting title name of the meeting\r\n */\r\n title?: string;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * Data structure to represent a conversation object.\r\n *\r\n * @internal\r\n */\r\n export interface IConversation {\r\n /**\r\n * @hidden\r\n * conversation id of the meeting\r\n */\r\n id: string;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * Data structure to represent an organizer object.\r\n *\r\n * @internal\r\n */\r\n export interface IOrganizer {\r\n /**\r\n * @hidden\r\n * organizer id of the meeting\r\n */\r\n id?: string;\r\n /**\r\n * @hidden\r\n * tenant id of the meeting\r\n */\r\n tenantId?: string;\r\n }\r\n\r\n export interface LiveStreamState {\r\n /**\r\n * indicates whether meeting is streaming\r\n */\r\n isStreaming: boolean;\r\n\r\n /**\r\n * error object in case there is a failure\r\n */\r\n error?: {\r\n /** error code from the streaming service, e.g. IngestionFailure */\r\n code: string;\r\n /** detailed error message string */\r\n message?: string;\r\n };\r\n }\r\n\r\n export interface IAppContentStageSharingCapabilities {\r\n /**\r\n * indicates whether app has permission to share contents to meeting stage\r\n */\r\n doesAppHaveSharePermission: boolean;\r\n }\r\n\r\n export interface IAppContentStageSharingState {\r\n /**\r\n * indicates whether app is currently being shared to stage\r\n */\r\n isAppSharing: boolean;\r\n }\r\n export interface ISpeakingState {\r\n /**\r\n * Indicates whether one or more participants in a meeting are speaking, or\r\n * if no participants are speaking\r\n */\r\n isSpeakingDetected: boolean;\r\n }\r\n\r\n export enum MeetingType {\r\n Unknown = 'Unknown',\r\n Adhoc = 'Adhoc',\r\n Scheduled = 'Scheduled',\r\n Recurring = 'Recurring',\r\n Broadcast = 'Broadcast',\r\n MeetNow = 'MeetNow',\r\n }\r\n\r\n export enum CallType {\r\n OneOnOneCall = 'oneOnOneCall',\r\n GroupCall = 'groupCall',\r\n }\r\n\r\n /**\r\n * Allows an app to get the incoming audio speaker setting for the meeting user\r\n *\r\n * @param callback - Callback contains 2 parameters, error and result.\r\n *\r\n * error can either contain an error of type SdkError, incase of an error, or null when fetch is successful\r\n * result can either contain the true/false value, incase of a successful fetch or null when the fetching fails\r\n * result: True means incoming audio is muted and false means incoming audio is unmuted\r\n */\r\n export function getIncomingClientAudioState(\r\n callback: (error: SdkError | null, result: boolean | null) => void,\r\n ): void {\r\n if (!callback) {\r\n throw new Error('[get incoming client audio state] Callback cannot be null');\r\n }\r\n ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);\r\n sendMessageToParent('getIncomingClientAudioState', callback);\r\n }\r\n\r\n /**\r\n * Allows an app to toggle the incoming audio speaker setting for the meeting user from mute to unmute or vice-versa\r\n *\r\n * @param callback - Callback contains 2 parameters, error and result.\r\n * error can either contain an error of type SdkError, incase of an error, or null when toggle is successful\r\n * result can either contain the true/false value, incase of a successful toggle or null when the toggling fails\r\n * result: True means incoming audio is muted and false means incoming audio is unmuted\r\n */\r\n export function toggleIncomingClientAudio(callback: (error: SdkError | null, result: boolean | null) => void): void {\r\n if (!callback) {\r\n throw new Error('[toggle incoming client audio] Callback cannot be null');\r\n }\r\n ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);\r\n sendMessageToParent('toggleIncomingClientAudio', callback);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n *\r\n * Allows an app to get the meeting details for the meeting\r\n *\r\n * @param callback - Callback contains 2 parameters, error and meetingDetailsResponse.\r\n * error can either contain an error of type SdkError, incase of an error, or null when get is successful\r\n * result can either contain a IMeetingDetailsResponse value, in case of a successful get or null when the get fails\r\n *\r\n * @internal\r\n */\r\n export function getMeetingDetails(\r\n callback: (error: SdkError | null, meetingDetails: IMeetingDetailsResponse | null) => void,\r\n ): void {\r\n if (!callback) {\r\n throw new Error('[get meeting details] Callback cannot be null');\r\n }\r\n ensureInitialized(\r\n FrameContexts.sidePanel,\r\n FrameContexts.meetingStage,\r\n FrameContexts.settings,\r\n FrameContexts.content,\r\n );\r\n sendMessageToParent('meeting.getMeetingDetails', callback);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Allows an app to get the authentication token for the anonymous or guest user in the meeting\r\n *\r\n * @param callback - Callback contains 2 parameters, error and authenticationTokenOfAnonymousUser.\r\n * error can either contain an error of type SdkError, incase of an error, or null when get is successful\r\n * authenticationTokenOfAnonymousUser can either contain a string value, incase of a successful get or null when the get fails\r\n *\r\n * @internal\r\n */\r\n export function getAuthenticationTokenForAnonymousUser(\r\n callback: (error: SdkError | null, authenticationTokenOfAnonymousUser: string | null) => void,\r\n ): void {\r\n if (!callback) {\r\n throw new Error('[get Authentication Token For AnonymousUser] Callback cannot be null');\r\n }\r\n ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);\r\n sendMessageToParent('meeting.getAuthenticationTokenForAnonymousUser', callback);\r\n }\r\n\r\n /**\r\n * Allows an app to get the state of the live stream in the current meeting\r\n *\r\n * @param callback - Callback contains 2 parameters: error and liveStreamState.\r\n * error can either contain an error of type SdkError, in case of an error, or null when get is successful\r\n * liveStreamState can either contain a LiveStreamState value, or null when operation fails\r\n */\r\n export function getLiveStreamState(\r\n callback: (error: SdkError | null, liveStreamState: LiveStreamState | null) => void,\r\n ): void {\r\n if (!callback) {\r\n throw new Error('[get live stream state] Callback cannot be null');\r\n }\r\n ensureInitialized(FrameContexts.sidePanel);\r\n sendMessageToParent('meeting.getLiveStreamState', callback);\r\n }\r\n\r\n /**\r\n * Allows an app to request the live streaming be started at the given streaming url\r\n *\r\n * @remarks\r\n * Use getLiveStreamState or registerLiveStreamChangedHandler to get updates on the live stream state\r\n *\r\n * @param streamUrl - the url to the stream resource\r\n * @param streamKey - the key to the stream resource\r\n * @param callback - Callback contains error parameter which can be of type SdkError in case of an error, or null when operation is successful\r\n */\r\n export function requestStartLiveStreaming(\r\n callback: (error: SdkError | null) => void,\r\n streamUrl: string,\r\n streamKey?: string,\r\n ): void {\r\n if (!callback) {\r\n throw new Error('[request start live streaming] Callback cannot be null');\r\n }\r\n ensureInitialized(FrameContexts.sidePanel);\r\n sendMessageToParent('meeting.requestStartLiveStreaming', [streamUrl, streamKey], callback);\r\n }\r\n\r\n /**\r\n * Allows an app to request the live streaming be stopped at the given streaming url\r\n *\r\n * @remarks\r\n * Use getLiveStreamState or registerLiveStreamChangedHandler to get updates on the live stream state\r\n *\r\n * @param callback - Callback contains error parameter which can be of type SdkError in case of an error, or null when operation is successful\r\n */\r\n export function requestStopLiveStreaming(callback: (error: SdkError | null) => void): void {\r\n if (!callback) {\r\n throw new Error('[request stop live streaming] Callback cannot be null');\r\n }\r\n ensureInitialized(FrameContexts.sidePanel);\r\n sendMessageToParent('meeting.requestStopLiveStreaming', callback);\r\n }\r\n\r\n /**\r\n * Registers a handler for changes to the live stream.\r\n *\r\n * @remarks\r\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\r\n *\r\n * @param handler - The handler to invoke when the live stream state changes\r\n */\r\n export function registerLiveStreamChangedHandler(handler: (liveStreamState: LiveStreamState) => void): void {\r\n if (!handler) {\r\n throw new Error('[register live stream changed handler] Handler cannot be null');\r\n }\r\n ensureInitialized(FrameContexts.sidePanel);\r\n registerHandler('meeting.liveStreamChanged', handler);\r\n }\r\n\r\n /**\r\n * Allows an app to share contents in the meeting\r\n *\r\n * @param callback - Callback contains 2 parameters, error and result.\r\n * error can either contain an error of type SdkError, incase of an error, or null when share is successful\r\n * result can either contain a true value, incase of a successful share or null when the share fails\r\n * @param appContentUrl - is the input URL which needs to be shared on to the stage\r\n */\r\n export function shareAppContentToStage(\r\n callback: (error: SdkError | null, result: boolean | null) => void,\r\n appContentUrl: string,\r\n ): void {\r\n if (!callback) {\r\n throw new Error('[share app content to stage] Callback cannot be null');\r\n }\r\n ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);\r\n sendMessageToParent('meeting.shareAppContentToStage', [appContentUrl], callback);\r\n }\r\n\r\n /**\r\n * Provides information related app's in-meeting sharing capabilities\r\n *\r\n * @param callback - Callback contains 2 parameters, error and result.\r\n * error can either contain an error of type SdkError (error indication), or null (non-error indication)\r\n * appContentStageSharingCapabilities can either contain an IAppContentStageSharingCapabilities object\r\n * (indication of successful retrieval), or null (indication of failed retrieval)\r\n */\r\n export function getAppContentStageSharingCapabilities(\r\n callback: (\r\n error: SdkError | null,\r\n appContentStageSharingCapabilities: IAppContentStageSharingCapabilities | null,\r\n ) => void,\r\n ): void {\r\n if (!callback) {\r\n throw new Error('[get app content stage sharing capabilities] Callback cannot be null');\r\n }\r\n ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);\r\n sendMessageToParent('meeting.getAppContentStageSharingCapabilities', callback);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs.\r\n * Terminates current stage sharing session in meeting\r\n *\r\n * @param callback - Callback contains 2 parameters, error and result.\r\n * error can either contain an error of type SdkError (error indication), or null (non-error indication)\r\n * result can either contain a true boolean value (successful termination), or null (unsuccessful fetch)\r\n */\r\n export function stopSharingAppContentToStage(\r\n callback: (error: SdkError | null, result: boolean | null) => void,\r\n ): void {\r\n if (!callback) {\r\n throw new Error('[stop sharing app content to stage] Callback cannot be null');\r\n }\r\n ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);\r\n sendMessageToParent('meeting.stopSharingAppContentToStage', callback);\r\n }\r\n\r\n /**\r\n * Provides information related to current stage sharing state for app\r\n *\r\n * @param callback - Callback contains 2 parameters, error and result.\r\n * error can either contain an error of type SdkError (error indication), or null (non-error indication)\r\n * appContentStageSharingState can either contain an IAppContentStageSharingState object\r\n * (indication of successful retrieval), or null (indication of failed retrieval)\r\n */\r\n export function getAppContentStageSharingState(\r\n callback: (error: SdkError | null, appContentStageSharingState: IAppContentStageSharingState | null) => void,\r\n ): void {\r\n if (!callback) {\r\n throw new Error('[get app content stage sharing state] Callback cannot be null');\r\n }\r\n ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);\r\n sendMessageToParent('meeting.getAppContentStageSharingState', callback);\r\n }\r\n\r\n /**\r\n * Registers a handler for changes to paticipant speaking states. If any participant is speaking, isSpeakingDetected\r\n * will be true. If no participants are speaking, isSpeakingDetected will be false. Only one handler can be registered\r\n * at a time. A subsequent registration replaces an existing registration.\r\n *\r\n * @param handler The handler to invoke when the speaking state of any participant changes (start/stop speaking).\r\n */\r\n export function registerSpeakingStateChangeHandler(handler: (speakingState: ISpeakingState) => void): void {\r\n if (!handler) {\r\n throw new Error('[registerSpeakingStateChangeHandler] Handler cannot be null');\r\n }\r\n ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);\r\n registerHandler('meeting.speakingStateChanged', handler);\r\n }\r\n}\r\n","import { sendAndHandleSdkError } from '../internal/communication';\r\nimport { ensureInitialized } from '../internal/internalAPIs';\r\nimport { callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise, InputFunction } from '../internal/utils';\r\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\r\nimport { SdkError } from './interfaces';\r\nimport { runtime } from './runtime';\r\n\r\nexport namespace monetization {\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * Data structure to represent a subscription plan.\r\n *\r\n * @internal\r\n */\r\n export interface PlanInfo {\r\n /**\r\n * @hidden\r\n * plan id\r\n */\r\n planId: string;\r\n /**\r\n * @hidden\r\n * term of the plan\r\n */\r\n term: string;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * Open dialog to start user's purchase experience\r\n *\r\n * @param planInfo optional parameter. It contains info of the subscription plan pushed to users.\r\n * error can either contain an error of type SdkError, incase of an error, or null when get is successful\r\n * @returns Promise that will be resolved when the operation has completed or rejected with SdkError value\r\n *\r\n * @internal\r\n */\r\n export function openPurchaseExperience(planInfo?: PlanInfo): Promise;\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link monetization.openPurchaseExperience monetization.openPurchaseExperience(planInfo?: PlanInfo): Promise\\} instead.\r\n *\r\n * @hidden\r\n * Hide from docs\r\n * Open dialog to start user's purchase experience\r\n *\r\n * @param callback Callback contains 1 parameters, error.\r\n * @param planInfo optional parameter. It contains info of the subscription plan pushed to users.\r\n * error can either contain an error of type SdkError, incase of an error, or null when get is successful\r\n *\r\n * @internal\r\n */\r\n export function openPurchaseExperience(callback: (error: SdkError | null) => void, planInfo?: PlanInfo): void;\r\n /**\r\n * @hidden\r\n * This function is the overloaded implementation of openPurchaseExperience.\r\n * Since the method signatures of the v1 callback and v2 promise differ in the type of the first parameter,\r\n * we need to do an extra check to know the typeof the @param1 to set the proper arguments of the utility function.\r\n * @param param1\r\n * @param param2\r\n * @returns Promise that will be resolved when the operation has completed or rejected with SdkError value\r\n */\r\n export function openPurchaseExperience(\r\n param1: ((error: SdkError | null) => void) | PlanInfo | undefined,\r\n param2?: PlanInfo,\r\n ): Promise {\r\n let callback: (error: SdkError | null) => void;\r\n let planInfo: PlanInfo;\r\n if (typeof param1 === 'function') {\r\n callback = param1;\r\n planInfo = param2;\r\n } else {\r\n planInfo = param1;\r\n }\r\n const wrappedFunction: InputFunction = () => {\r\n return new Promise(resolve => {\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n resolve(sendAndHandleSdkError('monetization.openPurchaseExperience', planInfo));\r\n });\r\n };\r\n\r\n ensureInitialized(FrameContexts.content);\r\n return callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise(wrappedFunction, callback);\r\n }\r\n\r\n export function isSupported(): boolean {\r\n return runtime.supports.monetization ? true : false;\r\n }\r\n}\r\n","import { sendAndHandleStatusAndReason as sendAndHandleError } from '../internal/communication';\r\nimport { createTeamsDeepLinkForCalendar } from '../internal/deepLinkUtilities';\r\nimport { ensureInitialized } from '../internal/internalAPIs';\r\nimport { FrameContexts } from './constants';\r\nimport { runtime } from './runtime';\r\n\r\nexport namespace calendar {\r\n export function openCalendarItem(openCalendarItemParams: OpenCalendarItemParams): Promise {\r\n return new Promise(resolve => {\r\n ensureInitialized(FrameContexts.content);\r\n if (!isSupported()) {\r\n throw new Error('Not supported');\r\n }\r\n\r\n if (!openCalendarItemParams.itemId || !openCalendarItemParams.itemId.trim()) {\r\n throw new Error('Must supply an itemId to openCalendarItem');\r\n }\r\n\r\n resolve(sendAndHandleError('calendar.openCalendarItem', openCalendarItemParams));\r\n });\r\n }\r\n export function composeMeeting(composeMeetingParams: ComposeMeetingParams): Promise {\r\n return new Promise(resolve => {\r\n ensureInitialized(FrameContexts.content);\r\n if (!isSupported()) {\r\n throw new Error('Not supported');\r\n }\r\n if (runtime.isLegacyTeams) {\r\n resolve(\r\n sendAndHandleError(\r\n 'executeDeepLink',\r\n createTeamsDeepLinkForCalendar(\r\n composeMeetingParams.attendees,\r\n composeMeetingParams.startTime,\r\n composeMeetingParams.endTime,\r\n composeMeetingParams.subject,\r\n composeMeetingParams.content,\r\n ),\r\n ),\r\n );\r\n } else {\r\n resolve(sendAndHandleError('calendar.composeMeeting', composeMeetingParams));\r\n }\r\n });\r\n }\r\n export function isSupported(): boolean {\r\n return runtime.supports.calendar ? true : false;\r\n }\r\n\r\n export interface OpenCalendarItemParams {\r\n itemId: string;\r\n }\r\n\r\n export interface ComposeMeetingParams {\r\n attendees?: string[];\r\n startTime?: string;\r\n endTime?: string;\r\n subject?: string;\r\n content?: string;\r\n }\r\n}\r\n","import { sendAndHandleStatusAndReason as sendAndHandleError } from '../internal/communication';\r\nimport { ensureInitialized } from '../internal/internalAPIs';\r\nimport { FrameContexts } from './constants';\r\nimport { runtime } from './runtime';\r\n\r\nexport namespace mail {\r\n export function openMailItem(openMailItemParams: OpenMailItemParams): Promise {\r\n return new Promise(resolve => {\r\n ensureInitialized(FrameContexts.content);\r\n if (!isSupported()) {\r\n throw new Error('Not supported');\r\n }\r\n\r\n if (!openMailItemParams.itemId || !openMailItemParams.itemId.trim()) {\r\n throw new Error('Must supply an itemId to openMailItem');\r\n }\r\n\r\n resolve(sendAndHandleError('mail.openMailItem', openMailItemParams));\r\n });\r\n }\r\n\r\n export function composeMail(composeMailParams: ComposeMailParams): Promise {\r\n return new Promise(resolve => {\r\n ensureInitialized(FrameContexts.content);\r\n if (!isSupported()) {\r\n throw new Error('Not supported');\r\n }\r\n\r\n resolve(sendAndHandleError('mail.composeMail', composeMailParams));\r\n });\r\n }\r\n\r\n export function isSupported(): boolean {\r\n return runtime.supports.mail ? true : false;\r\n }\r\n\r\n export interface OpenMailItemParams {\r\n itemId: string;\r\n }\r\n\r\n export enum ComposeMailType {\r\n New = 'new',\r\n Reply = 'reply',\r\n ReplyAll = 'replyAll',\r\n Forward = 'forward',\r\n }\r\n\r\n /**\r\n * Base of a discriminated union between compose scenarios.\r\n */\r\n interface ComposeMailBase {\r\n type: T;\r\n }\r\n /**\r\n * Interfaces for each type.\r\n */\r\n export interface ComposeNewParams extends ComposeMailBase {\r\n toRecipients?: string[];\r\n ccRecipients?: string[];\r\n bccRecipients?: string[];\r\n subject?: string;\r\n message?: string;\r\n }\r\n export interface ComposeReplyOrForwardParams extends ComposeMailBase {\r\n itemid: string;\r\n }\r\n\r\n export type ComposeMailParams =\r\n | ComposeNewParams\r\n | ComposeReplyOrForwardParams\r\n | ComposeReplyOrForwardParams\r\n | ComposeReplyOrForwardParams;\r\n}\r\n","import { sendAndHandleSdkError as sendAndHandleError } from '../internal/communication';\r\nimport { peoplePickerRequiredVersion } from '../internal/constants';\r\nimport { ensureInitialized, isCurrentSDKVersionAtLeast } from '../internal/internalAPIs';\r\nimport { validatePeoplePickerInput } from '../internal/mediaUtil';\r\nimport { callCallbackWithErrorOrResultFromPromiseAndReturnPromise } from '../internal/utils';\r\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\r\nimport { ErrorCode, SdkError } from './interfaces';\r\nimport { runtime } from './runtime';\r\n\r\nexport namespace people {\r\n /**\r\n * Launches a people picker and allows the user to select one or more people from the list\r\n * If the app is added to personal app scope the people picker launched is org wide and if the app is added to a chat/channel, people picker launched is also limited to the members of chat/channel\r\n \r\n * @param callback - Returns list of JSON object of type PeoplePickerResult which consists of AAD IDs, display names and emails of the selected users\r\n * @param peoplePickerInputs - Input parameters to launch customized people picker\r\n * @returns Promise that will be fulfilled when the operation has completed\r\n */\r\n export function selectPeople(peoplePickerInputs?: PeoplePickerInputs): Promise;\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link people.selectPeople people.selectPeople(peoplePickerInputs?: PeoplePickerInputs): Promise\\} instead.\r\n *\r\n * Launches a people picker and allows the user to select one or more people from the list\r\n * If the app is added to personal app scope the people picker launched is org wide and if the app is added to a chat/channel, people picker launched is also limited to the members of chat/channel\r\n \r\n * @param callback - Returns list of JSON object of type PeoplePickerResult which consists of AAD IDs, display names and emails of the selected users\r\n * @param peoplePickerInputs - Input parameters to launch customized people picker\r\n */\r\n export function selectPeople(\r\n callback: (error: SdkError, people: PeoplePickerResult[]) => void,\r\n peoplePickerInputs?: PeoplePickerInputs,\r\n ): void;\r\n /**\r\n * @hidden\r\n * This function is the overloaded implementation of selectPeople.\r\n * Since the method signatures of the v1 callback and v2 promise differ in the type of the first parameter,\r\n * we need to do an extra check to know the typeof the @param1 to set the proper arguments of the utility function.\r\n * @param param1\r\n * @param param2\r\n * @returns Promise of Array of PeoplePickerResult objects.\r\n */\r\n export function selectPeople(\r\n param1: PeoplePickerInputs | ((error: SdkError, people: PeoplePickerResult[]) => void) | undefined,\r\n param2?: PeoplePickerInputs,\r\n ): Promise {\r\n ensureInitialized(FrameContexts.content, FrameContexts.task, FrameContexts.settings);\r\n\r\n let callback: (error: SdkError, people: PeoplePickerResult[]) => void;\r\n let peoplePickerInputs: PeoplePickerInputs;\r\n\r\n if (typeof param1 === 'function') {\r\n [callback, peoplePickerInputs] = [param1, param2];\r\n } else {\r\n peoplePickerInputs = param1;\r\n }\r\n\r\n return callCallbackWithErrorOrResultFromPromiseAndReturnPromise(\r\n selectPeopleHelper,\r\n callback,\r\n peoplePickerInputs,\r\n );\r\n }\r\n\r\n function selectPeopleHelper(peoplePickerInputs?: PeoplePickerInputs): Promise {\r\n return new Promise(resolve => {\r\n if (!isCurrentSDKVersionAtLeast(peoplePickerRequiredVersion)) {\r\n throw { errorCode: ErrorCode.OLD_PLATFORM };\r\n }\r\n\r\n if (!validatePeoplePickerInput(peoplePickerInputs)) {\r\n throw { errorCode: ErrorCode.INVALID_ARGUMENTS };\r\n }\r\n\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n resolve(sendAndHandleError('people.selectPeople', peoplePickerInputs));\r\n });\r\n }\r\n\r\n /**\r\n * Input parameter supplied to the People Picker API\r\n */\r\n export interface PeoplePickerInputs {\r\n /**\r\n * Optional; Set title for the people picker\r\n * Default value is \"Select people\" for multiselect and \"Select a person\" for single select\r\n */\r\n title?: string;\r\n\r\n /**\r\n * Optional; AAD ids of the users to be pre-populated in the search box of people picker control\r\n * If single select is enabled this value, only the first user in the list will be pre-populated\r\n * Default value is null\r\n */\r\n setSelected?: string[];\r\n\r\n /**\r\n * Optional; launches the people picker in org wide scope even if the app is added to a chat or channel\r\n * Default value is false\r\n */\r\n openOrgWideSearchInChatOrChannel?: boolean;\r\n\r\n /**\r\n * Optional; launches the people picker for which only 1 person can be selected\r\n * Default value is false\r\n */\r\n singleSelect?: boolean;\r\n }\r\n\r\n /**\r\n * Output user object of people picker API\r\n */\r\n export interface PeoplePickerResult {\r\n /**\r\n * user object Id (also known as aad id) of the selected user\r\n */\r\n objectId: string;\r\n\r\n /**\r\n * Optional; display name of the selected user\r\n */\r\n displayName?: string;\r\n\r\n /**\r\n * Optional; email of the selected user\r\n */\r\n email?: string;\r\n }\r\n\r\n export function isSupported(): boolean {\r\n return runtime.supports.people ? true : false;\r\n }\r\n}\r\n","import { sendMessageToParent } from '../internal/communication';\r\nimport { registerHandler } from '../internal/handlers';\r\nimport { ensureInitialized } from '../internal/internalAPIs';\r\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\r\nimport { runtime } from './runtime';\r\n\r\n/**\r\n * Namespace to video extensibility of the SDK\r\n */\r\nexport namespace video {\r\n /**\r\n * Represents a video frame\r\n */\r\n export interface VideoFrame {\r\n /**\r\n * Video frame width\r\n */\r\n width: number;\r\n /**\r\n * Video frame height\r\n */\r\n height: number;\r\n /**\r\n * Video frame buffer\r\n */\r\n data: Uint8ClampedArray;\r\n /**\r\n * NV12 luma stride, valid only when video frame format is NV12\r\n */\r\n lumaStride?: number;\r\n /**\r\n * NV12 chroma stride, valid only when video frame format is NV12\r\n */\r\n chromaStride?: number;\r\n /**\r\n * RGB stride, valid only when video frame format is RGB\r\n */\r\n stride?: number;\r\n }\r\n\r\n /**\r\n * Video frame format enum, currently only support NV12\r\n */\r\n export enum VideoFrameFormat {\r\n NV12,\r\n }\r\n\r\n /**\r\n * Video frame configuration supplied to the host to customize the generated video frame parameters, like format\r\n */\r\n export interface VideoFrameConfig {\r\n /**\r\n * video format\r\n */\r\n format: VideoFrameFormat;\r\n }\r\n\r\n /**\r\n * Video effect change type enum\r\n */\r\n export enum EffectChangeType {\r\n /**\r\n * current video effect changed\r\n */\r\n EffectChanged,\r\n /**\r\n * disable the video effect\r\n */\r\n EffectDisabled,\r\n }\r\n\r\n /**\r\n * Video frame call back function definition\r\n */\r\n export type VideoFrameCallback = (\r\n frame: VideoFrame,\r\n notifyVideoFrameProcessed: () => void,\r\n notifyError: (errorMessage: string) => void,\r\n ) => void;\r\n\r\n /**\r\n * Video effect change call back function definition\r\n */\r\n export type VideoEffectCallBack = (effectId: string | undefined) => void;\r\n\r\n /**\r\n * Register to read the video frames in Permissions section\r\n * @param frameCallback - The callback to invoke when registerForVideoFrame has completed\r\n * @param config - VideoFrameConfig to customize generated video frame parameters\r\n */\r\n export function registerForVideoFrame(frameCallback: VideoFrameCallback, config: VideoFrameConfig): void {\r\n ensureInitialized(FrameContexts.sidePanel);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n\r\n registerHandler('video.newVideoFrame', (videoFrame: VideoFrame) => {\r\n if (videoFrame !== undefined) {\r\n frameCallback(videoFrame, notifyVideoFrameProcessed, notifyError);\r\n }\r\n });\r\n sendMessageToParent('video.registerForVideoFrame', [config]);\r\n }\r\n\r\n /**\r\n * video extension should call this to notify host client that the current selected effect parameter changed.\r\n * If it's pre-meeting, host client will call videoEffectCallback immediately then use the videoEffect.\r\n * If it's the in-meeting scenario, we will call videoEffectCallback when apply button clicked.\r\n *\r\n * @param effectChangeType - the effect change type.\r\n * @param effectId - Newly selected effect id.\r\n */\r\n export function notifySelectedVideoEffectChanged(\r\n effectChangeType: EffectChangeType,\r\n effectId: string | undefined,\r\n ): void {\r\n ensureInitialized(FrameContexts.sidePanel);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n sendMessageToParent('video.videoEffectChanged', [effectChangeType, effectId]);\r\n }\r\n\r\n /**\r\n * Register the video effect callback, host client uses this to notify the video extension the new video effect will by applied\r\n * @param callback - The VideoEffectCallback to invoke when registerForVideoEffect has completed\r\n */\r\n export function registerForVideoEffect(callback: VideoEffectCallBack): void {\r\n ensureInitialized(FrameContexts.sidePanel);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n registerHandler('video.effectParameterChange', callback);\r\n }\r\n\r\n /**\r\n * Sending notification to host client finished the video frame processing, now host client can render this video frame\r\n * or pass the video frame to next one in video pipeline\r\n */\r\n function notifyVideoFrameProcessed(): void {\r\n sendMessageToParent('video.videoFrameProcessed');\r\n }\r\n\r\n /**\r\n * Sending error notification to host client\r\n * @param errorMessage - The error message that will be sent to the host\r\n */\r\n function notifyError(errorMessage: string): void {\r\n sendMessageToParent('video.notifyError', [errorMessage]);\r\n }\r\n\r\n /**\r\n * Checks if video capability is supported by the host\r\n * @returns true if the video capability is enabled in runtime.supports.video and\r\n * false if it is disabled\r\n */\r\n export function isSupported(): boolean {\r\n return runtime.supports.video ? true : false;\r\n }\r\n} //end of video namespace\r\n","import { sendAndHandleSdkError } from '../internal/communication';\r\nimport { ensureInitialized } from '../internal/internalAPIs';\r\nimport { callCallbackWithSdkErrorFromPromiseAndReturnPromise, InputFunction } from '../internal/utils';\r\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\r\nimport { ErrorCode, SdkError } from './interfaces';\r\nimport { runtime } from './runtime';\r\n\r\nexport namespace sharing {\r\n export const SharingAPIMessages = {\r\n shareWebContent: 'sharing.shareWebContent',\r\n };\r\n\r\n // More types can be added as we expand share capability\r\n type ContentType = 'URL';\r\n\r\n interface IBaseSharedContent {\r\n type: ContentType;\r\n }\r\n\r\n // More types can be added as we expand share capability\r\n export type IShareRequestContentType = IURLContent;\r\n\r\n export interface IShareRequest {\r\n content: T[];\r\n }\r\n\r\n export interface IURLContent extends IBaseSharedContent {\r\n type: 'URL';\r\n\r\n /**\r\n * Required URL\r\n */\r\n url: string;\r\n\r\n /**\r\n * Default initial message text\r\n */\r\n message?: string;\r\n\r\n /**\r\n * Show URL preview, defaults to true\r\n */\r\n preview?: boolean;\r\n }\r\n\r\n /**\r\n * Feature is under development\r\n * Opens a share dialog for web content\r\n *\r\n * @param shareWebContentRequest - web content info\r\n * @returns Promise that will be fulfilled when the operation has completed\r\n */\r\n export function shareWebContent(shareWebContentRequest: IShareRequest): Promise;\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link sharing.shareWebContent sharing.shareWebContent(shareWebContentRequest: IShareRequest\\): Promise\\} instead.\r\n *\r\n * Feature is under development\r\n * Opens a share dialog for web content\r\n *\r\n * @param shareWebContentRequest - web content info\r\n * @param callback - optional callback\r\n */\r\n export function shareWebContent(\r\n shareWebContentRequest: IShareRequest,\r\n callback: (err?: SdkError) => void,\r\n ): void;\r\n export function shareWebContent(\r\n shareWebContentRequest: IShareRequest,\r\n callback?: (err?: SdkError) => void,\r\n ): Promise {\r\n // validate the given input (synchronous check)\r\n try {\r\n validateNonEmptyContent(shareWebContentRequest);\r\n validateTypeConsistency(shareWebContentRequest);\r\n validateContentForSupportedTypes(shareWebContentRequest);\r\n } catch (err) {\r\n //return the error via callback(v1) or rejected promise(v2)\r\n const wrappedFunction: InputFunction = () => Promise.reject(err);\r\n return callCallbackWithSdkErrorFromPromiseAndReturnPromise(wrappedFunction, callback);\r\n }\r\n ensureInitialized(\r\n FrameContexts.content,\r\n FrameContexts.sidePanel,\r\n FrameContexts.task,\r\n FrameContexts.stage,\r\n FrameContexts.meetingStage,\r\n );\r\n return callCallbackWithSdkErrorFromPromiseAndReturnPromise(shareWebContentHelper, callback, shareWebContentRequest);\r\n }\r\n\r\n function shareWebContentHelper(shareWebContentRequest: IShareRequest): Promise {\r\n return new Promise(resolve => {\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n resolve(sendAndHandleSdkError(SharingAPIMessages.shareWebContent, shareWebContentRequest));\r\n });\r\n }\r\n\r\n /**\r\n * Functions for validating the shareRequest input parameter\r\n */\r\n function validateNonEmptyContent(shareRequest: IShareRequest): void {\r\n if (!(shareRequest && shareRequest.content && shareRequest.content.length)) {\r\n const err: SdkError = {\r\n errorCode: ErrorCode.INVALID_ARGUMENTS,\r\n message: 'Shared content is missing',\r\n };\r\n throw err;\r\n }\r\n }\r\n\r\n function validateTypeConsistency(shareRequest: IShareRequest): void {\r\n let err: SdkError;\r\n if (shareRequest.content.some(item => !item.type)) {\r\n err = {\r\n errorCode: ErrorCode.INVALID_ARGUMENTS,\r\n message: 'Shared content type cannot be undefined',\r\n };\r\n throw err;\r\n }\r\n if (shareRequest.content.some(item => item.type !== shareRequest.content[0].type)) {\r\n err = {\r\n errorCode: ErrorCode.INVALID_ARGUMENTS,\r\n message: 'Shared content must be of the same type',\r\n };\r\n throw err;\r\n }\r\n }\r\n\r\n function validateContentForSupportedTypes(shareRequest: IShareRequest): void {\r\n let err: SdkError;\r\n if (shareRequest.content[0].type === 'URL') {\r\n if (shareRequest.content.some(item => !item.url)) {\r\n err = {\r\n errorCode: ErrorCode.INVALID_ARGUMENTS,\r\n message: 'URLs are required for URL content types',\r\n };\r\n throw err;\r\n }\r\n } else {\r\n err = {\r\n errorCode: ErrorCode.INVALID_ARGUMENTS,\r\n message: 'Content type is unsupported',\r\n };\r\n throw err;\r\n }\r\n }\r\n\r\n export function isSupported(): boolean {\r\n return runtime.supports.sharing ? true : false;\r\n }\r\n}\r\n","import { sendAndHandleSdkError } from '../internal/communication';\r\nimport { ensureInitialized } from '../internal/internalAPIs';\r\nimport { FrameContexts } from './constants';\r\n\r\n/**\r\n * Namespace to interact with the stage view specific part of the SDK.\r\n */\r\nexport namespace stageView {\r\n /**\r\n * Parameters to open a stage view.\r\n */\r\n export interface StageViewParams {\r\n /**\r\n * The ID of the Teams application to be opened.\r\n */\r\n appId: string;\r\n\r\n /**\r\n * The URL of the content to display.\r\n */\r\n contentUrl: string;\r\n\r\n /**\r\n * The chat or channel ID.\r\n */\r\n threadId: string;\r\n\r\n /**\r\n * The title to give the stage view.\r\n */\r\n title: string;\r\n\r\n /**\r\n * The Teams application website URL.\r\n */\r\n websiteUrl?: string;\r\n\r\n /**\r\n * The entity ID of the Teams application content being opened.\r\n */\r\n entityId?: string;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Feature is under development\r\n *\r\n * Opens a stage view to display a Teams application\r\n * @param stageViewParams - The parameters to pass into the stage view.\r\n * @returns Promise that resolves or rejects with an error once the stage view is closed.\r\n */\r\n export function open(stageViewParams: StageViewParams): Promise {\r\n return new Promise(resolve => {\r\n ensureInitialized(FrameContexts.content);\r\n\r\n if (!stageViewParams) {\r\n throw new Error('[stageView.open] Stage view params cannot be null');\r\n }\r\n\r\n resolve(sendAndHandleSdkError('stageView.open', stageViewParams));\r\n });\r\n }\r\n}\r\n","import { sendMessageToParent } from '../internal/communication';\r\nimport { sendAndHandleSdkError as sendAndHandleError } from '../internal/communication';\r\nimport { createTeamsDeepLinkForCall } from '../internal/deepLinkUtilities';\r\nimport { ensureInitialized } from '../internal/internalAPIs';\r\nimport { FrameContexts } from './constants';\r\nimport { runtime } from './runtime';\r\n\r\nexport namespace call {\r\n export enum CallModalities {\r\n Unknown = 'unknown',\r\n Audio = 'audio',\r\n Video = 'video',\r\n VideoBasedScreenSharing = 'videoBasedScreenSharing',\r\n Data = 'data',\r\n }\r\n\r\n export interface StartCallParams {\r\n // comma-separated list of user IDs representing the participants of the call.\r\n // Currently the User ID field supports the Azure AD UserPrincipalName,\r\n // typically an email address, or in case of a PSTN call, it supports a pstn\r\n // mri 4:.\r\n targets: string[];\r\n // List of modalities for the call. Defaults to [“audio”].\r\n requestedModalities?: CallModalities[];\r\n // An optional parameter that informs about the source of the deep link\r\n source?: string;\r\n }\r\n\r\n /**\r\n * Starts a call with other users\r\n *\r\n * @param startCallParams - Parameters for the call\r\n * @returns If the call is accepted\r\n */\r\n export function startCall(startCallParams: StartCallParams): Promise {\r\n return new Promise(resolve => {\r\n ensureInitialized(FrameContexts.content);\r\n if (!isSupported()) {\r\n throw new Error('Not supported');\r\n }\r\n if (runtime.isLegacyTeams) {\r\n resolve(\r\n sendAndHandleError(\r\n 'executeDeepLink',\r\n createTeamsDeepLinkForCall(\r\n startCallParams.targets,\r\n startCallParams.requestedModalities?.includes(CallModalities.Video),\r\n startCallParams.source,\r\n ),\r\n ),\r\n );\r\n } else {\r\n return sendMessageToParent('call.startCall', [startCallParams], resolve);\r\n }\r\n });\r\n }\r\n\r\n export function isSupported(): boolean {\r\n return runtime.supports.call ? true : false;\r\n }\r\n}\r\n","import { app } from './app';\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link app} namespace instead.\r\n */\r\nexport namespace appInitialization {\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link app.Messages} instead.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n export import Messages = app.Messages;\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link app.FailedReason} instead.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n export import FailedReason = app.FailedReason;\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link app.ExpectedFailureReason} instead.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n export import ExpectedFailureReason = app.ExpectedFailureReason;\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link app.IFailedRequest} instead.\r\n */\r\n export import IFailedRequest = app.IFailedRequest;\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link app.IExpectedFailureRequest} instead.\r\n */\r\n export import IExpectedFailureRequest = app.IExpectedFailureRequest;\r\n\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link app.notifyAppLoaded app.notifyAppLoaded(): void} instead.\r\n *\r\n * Notifies the frame that app has loaded and to hide the loading indicator if one is shown.\r\n */\r\n export function notifyAppLoaded(): void {\r\n app.notifyAppLoaded();\r\n }\r\n\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link app.notifySuccess app.notifySuccess(): void} instead.\r\n *\r\n * Notifies the frame that app initialization is successful and is ready for user interaction.\r\n */\r\n export function notifySuccess(): void {\r\n app.notifySuccess();\r\n }\r\n\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link app.notifyFailure app.notifyFailure(appInitializationFailedRequest: IFailedRequest): void} instead.\r\n *\r\n * Notifies the frame that app initialization has failed and to show an error page in its place.\r\n * @param appInitializationFailedRequest - The failure request containing the reason for why the app failed\r\n * during initialization as well as an optional message.\r\n */\r\n export function notifyFailure(appInitializationFailedRequest: IFailedRequest): void {\r\n app.notifyFailure(appInitializationFailedRequest);\r\n }\r\n\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link app.notifyExpectedFailure app.notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void} instead.\r\n *\r\n * Notifies the frame that app initialized with some expected errors.\r\n * @param expectedFailureRequest - The expected failure request containing the reason and an optional message\r\n */\r\n export function notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void {\r\n app.notifyExpectedFailure(expectedFailureRequest);\r\n }\r\n}\r\n","import { ensureInitialized } from '../internal/internalAPIs';\r\nimport { getGenericOnCompleteHandler } from '../internal/utils';\r\nimport { FrameContexts } from './constants';\r\nimport { pages } from './pages';\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link pages.config} namespace instead.\r\n *\r\n * Namespace to interact with the settings-specific part of the SDK.\r\n * This object is usable only on the settings frame.\r\n */\r\nexport namespace settings {\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link pages.config.Config} instead.\r\n * @remarks\r\n * Renamed to config in pages.Config\r\n */\r\n export import Settings = pages.InstanceConfig;\r\n\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link pages.config.SaveEvent} instead.\r\n * @remarks\r\n * See pages.SaveEvent\r\n */\r\n export import SaveEvent = pages.config.SaveEvent;\r\n\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link pages.config.RemoveEvent} instead.\r\n * @remarks\r\n * See pages.RemoveEvent\r\n */\r\n export import RemoveEvent = pages.config.RemoveEvent;\r\n\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link pages.config.SaveParameters} instead.\r\n * @remarks\r\n * See pages.SaveParameters\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n export import SaveParameters = pages.config.SaveParameters;\r\n\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link pages.config.setValidityState pages.config.setValidityState(validityState: boolean): void} instead.\r\n *\r\n * Sets the validity state for the settings.\r\n * The initial value is false, so the user cannot save the settings until this is called with true.\r\n *\r\n * @param validityState - Indicates whether the save or remove button is enabled for the user.\r\n */\r\n export function setValidityState(validityState: boolean): void {\r\n pages.config.setValidityState(validityState);\r\n }\r\n\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link pages.config.getConfig pages.config.getConfig(): Promise\\} instead.\r\n *\r\n * Gets the settings for the current instance.\r\n *\r\n * @param callback - The callback to invoke when the {@link Settings} object is retrieved.\r\n */\r\n export function getSettings(callback: (instanceSettings: Settings) => void): void {\r\n ensureInitialized(FrameContexts.content, FrameContexts.settings, FrameContexts.remove, FrameContexts.sidePanel);\r\n pages.getConfig().then((config: pages.InstanceConfig) => {\r\n callback(config);\r\n });\r\n }\r\n\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link pages.config.setConfig pages.config.setConfig(instanceSettings: Config): Promise\\} instead.\r\n *\r\n * Sets the settings for the current instance.\r\n * This is an asynchronous operation; calls to getSettings are not guaranteed to reflect the changed state.\r\n *\r\n * @param - Set the desired settings for this instance.\r\n */\r\n export function setSettings(\r\n instanceSettings: Settings,\r\n onComplete?: (status: boolean, reason?: string) => void,\r\n ): void {\r\n ensureInitialized(FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);\r\n onComplete = onComplete ? onComplete : getGenericOnCompleteHandler();\r\n pages.config\r\n .setConfig(instanceSettings)\r\n .then(() => {\r\n onComplete(true);\r\n })\r\n .catch((error: Error) => {\r\n onComplete(false, error.message);\r\n });\r\n }\r\n\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link pages.config.registerOnSaveHandler pages.config.registerOnSaveHandler(handler: (evt: SaveEvent) => void): void} instead.\r\n *\r\n * Registers a handler for when the user attempts to save the settings. This handler should be used\r\n * to create or update the underlying resource powering the content.\r\n * The object passed to the handler must be used to notify whether to proceed with the save.\r\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\r\n *\r\n * @param handler - The handler to invoke when the user selects the save button.\r\n */\r\n export function registerOnSaveHandler(handler: (evt: SaveEvent) => void): void {\r\n pages.config.registerOnSaveHandler(handler);\r\n }\r\n\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link pages.config.registerOnRemoveHandler pages.config.registerOnRemoveHandler(handler: (evt: RemoveEvent) => void): void} instead.\r\n *\r\n * Registers a handler for user attempts to remove content. This handler should be used\r\n * to remove the underlying resource powering the content.\r\n * The object passed to the handler must be used to indicate whether to proceed with the removal.\r\n * Only one handler may be registered at a time. Subsequent registrations will override the first.\r\n *\r\n * @param handler - The handler to invoke when the user selects the remove button.\r\n */\r\n export function registerOnRemoveHandler(handler: (evt: RemoveEvent) => void): void {\r\n pages.config.registerOnRemoveHandler(handler);\r\n }\r\n}\r\n","import { ensureInitialized } from '../internal/internalAPIs';\r\nimport { getGenericOnCompleteHandler } from '../internal/utils';\r\nimport { app } from './app';\r\nimport { FrameContexts } from './constants';\r\nimport {\r\n Context,\r\n DeepLinkParameters,\r\n FrameContext,\r\n LoadContext,\r\n TabInformation,\r\n TabInstanceParameters,\r\n} from './interfaces';\r\nimport { pages } from './pages';\r\nimport { teamsCore } from './teamsAPIs';\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link app.initialize app.initialize(validMessageOrigins?: string[]): Promise\\} instead.\r\n *\r\n * Initializes the library. This must be called before any other SDK calls\r\n * but after the frame is loaded successfully.\r\n * @param callback - Optionally specify a callback to invoke when Teams SDK has successfully initialized\r\n * @param validMessageOrigins - Optionally specify a list of cross frame message origins. There must have\r\n * https: protocol otherwise they will be ignored. Example: https://www.example.com\r\n */\r\nexport function initialize(callback?: () => void, validMessageOrigins?: string[]): void {\r\n app.initialize(validMessageOrigins).then(() => {\r\n if (callback) {\r\n callback();\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link app._initialize app._initialize(hostWindow: any): void} instead.\r\n *\r\n * @hidden\r\n * Hide from docs.\r\n * ------\r\n * Undocumented function used to set a mock window for unit tests\r\n *\r\n * @internal\r\n */\r\n// eslint-disable-next-line\r\nexport function _initialize(hostWindow: any): void {\r\n app._initialize(hostWindow);\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link app._uninitialize app._uninitialize(): void} instead.\r\n *\r\n * @hidden\r\n * Hide from docs.\r\n * ------\r\n * Undocumented function used to clear state between unit tests\r\n *\r\n * @internal\r\n */\r\nexport function _uninitialize(): void {\r\n app._uninitialize();\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link teamsCore.enablePrintCapability teamsCore.enablePrintCapability(): void} instead.\r\n *\r\n * Enable print capability to support printing page using Ctrl+P and cmd+P\r\n */\r\nexport function enablePrintCapability(): void {\r\n teamsCore.enablePrintCapability();\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link teamsCore.print teamsCore.print(): void} instead.\r\n *\r\n * Default print handler\r\n */\r\nexport function print(): void {\r\n teamsCore.print();\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link app.getContext app.getContext(): Promise\\} instead.\r\n *\r\n * Retrieves the current context the frame is running in.\r\n *\r\n * @param callback - The callback to invoke when the {@link Context} object is retrieved.\r\n */\r\nexport function getContext(callback: (context: Context) => void): void {\r\n ensureInitialized();\r\n app.getContext().then((context: app.Context) => {\r\n if (callback) {\r\n callback(transformAppContextToLegacyContext(context));\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link app.registerOnThemeChangeHandler app.registerOnThemeChangeHandler(handler: (theme: string) => void): void} instead.\r\n *\r\n * Registers a handler for theme changes.\r\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\r\n *\r\n * @param handler - The handler to invoke when the user changes their theme.\r\n */\r\nexport function registerOnThemeChangeHandler(handler: (theme: string) => void): void {\r\n app.registerOnThemeChangeHandler(handler);\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link pages.registerFullScreenHandler pages.registerFullScreenHandler(handler: (isFullScreen: boolean) => void): void} instead.\r\n *\r\n * Registers a handler for changes from or to full-screen view for a tab.\r\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\r\n *\r\n * @param handler - The handler to invoke when the user toggles full-screen view for a tab.\r\n */\r\nexport function registerFullScreenHandler(handler: (isFullScreen: boolean) => void): void {\r\n pages.registerFullScreenHandler(handler);\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link pages.appButton.onClick pages.appButton.onClick(handler: () => void): void} instead.\r\n *\r\n * Registers a handler for clicking the app button.\r\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\r\n *\r\n * @param handler - The handler to invoke when the personal app button is clicked in the app bar.\r\n */\r\nexport function registerAppButtonClickHandler(handler: () => void): void {\r\n pages.appButton.onClick(handler);\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link pages.appButton.onHoverEnter pages.appButton.onHoverEnter(handler: () => void): void} instead.\r\n *\r\n * Registers a handler for entering hover of the app button.\r\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\r\n *\r\n * @param handler - The handler to invoke when entering hover of the personal app button in the app bar.\r\n */\r\nexport function registerAppButtonHoverEnterHandler(handler: () => void): void {\r\n pages.appButton.onHoverEnter(handler);\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link pages.appButton.onHoverLeave pages.appButton.onHoverLeave(handler: () => void): void} instead.\r\n *\r\n * Registers a handler for exiting hover of the app button.\r\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\r\n * @param handler - The handler to invoke when exiting hover of the personal app button in the app bar.\r\n *\r\n */\r\nexport function registerAppButtonHoverLeaveHandler(handler: () => void): void {\r\n pages.appButton.onHoverLeave(handler);\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link pages.backStack.registerBackButtonHandler pages.backStack.registerBackButtonHandler(handler: () => boolean): void} instead.\r\n *\r\n * Registers a handler for user presses of the Team client's back button. Experiences that maintain an internal\r\n * navigation stack should use this handler to navigate the user back within their frame. If an app finds\r\n * that after running its back button handler it cannot handle the event it should call the navigateBack\r\n * method to ask the Teams client to handle it instead.\r\n *\r\n * @param handler - The handler to invoke when the user presses their Team client's back button.\r\n */\r\nexport function registerBackButtonHandler(handler: () => boolean): void {\r\n pages.backStack.registerBackButtonHandler(handler);\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link teamsCore.registerOnLoadHandler teamsCore.registerOnLoadHandler(handler: (context: LoadContext) => void): void} instead.\r\n *\r\n * @hidden\r\n * Registers a handler to be called when the page has been requested to load.\r\n *\r\n * @param handler - The handler to invoke when the page is loaded.\r\n */\r\nexport function registerOnLoadHandler(handler: (context: LoadContext) => void): void {\r\n teamsCore.registerOnLoadHandler(handler);\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link teamsCore.registerBeforeUnloadHandler teamsCore.registerBeforeUnloadHandler(handler: (readyToUnload: () => void) => boolean): void} instead.\r\n *\r\n * @hidden\r\n * Registers a handler to be called before the page is unloaded.\r\n *\r\n * @param handler - The handler to invoke before the page is unloaded. If this handler returns true the page should\r\n * invoke the readyToUnload function provided to it once it's ready to be unloaded.\r\n */\r\nexport function registerBeforeUnloadHandler(handler: (readyToUnload: () => void) => boolean): void {\r\n teamsCore.registerBeforeUnloadHandler(handler);\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link pages.registerFocusEnterHandler pages.registerFocusEnterHandler(handler: (navigateForward: boolean) => void): void} instead.\r\n *\r\n * @hidden\r\n * Registers a handler when focus needs to be passed from teams to the place of choice on app.\r\n *\r\n * @param handler - The handler to invoked by the app when they want the focus to be in the place of their choice.\r\n */\r\nexport function registerFocusEnterHandler(handler: (navigateForward: boolean) => boolean): void {\r\n pages.registerFocusEnterHandler(handler);\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link pages.config.registerChangeConfigHandler pages.config.registerChangeConfigHandler(handler: () => void): void} instead.\r\n *\r\n * Registers a handler for when the user reconfigurated tab.\r\n *\r\n * @param handler - The handler to invoke when the user click on Settings.\r\n */\r\nexport function registerChangeSettingsHandler(handler: () => void): void {\r\n pages.config.registerChangeConfigHandler(handler);\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link pages.tabs.getTabInstances pages.tabs.getTabInstances(tabInstanceParameters?: TabInstanceParameters): Promise\\} instead.\r\n *\r\n * Allows an app to retrieve for this user tabs that are owned by this app.\r\n * If no TabInstanceParameters are passed, the app defaults to favorite teams and favorite channels.\r\n *\r\n * @param callback - The callback to invoke when the {@link TabInstanceParameters} object is retrieved.\r\n * @param tabInstanceParameters - OPTIONAL Flags that specify whether to scope call to favorite teams or channels.\r\n */\r\nexport function getTabInstances(\r\n callback: (tabInfo: TabInformation) => void,\r\n tabInstanceParameters?: TabInstanceParameters,\r\n): void {\r\n ensureInitialized();\r\n pages.tabs.getTabInstances(tabInstanceParameters).then((tabInfo: TabInformation) => {\r\n callback(tabInfo);\r\n });\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link pages.tabs.getMruTabInstances pages.tabs.getMruTabInstances(tabInstanceParameters?: TabInstanceParameters): Promise\\} instead.\r\n *\r\n * Allows an app to retrieve the most recently used tabs for this user.\r\n *\r\n * @param callback - The callback to invoke when the {@link TabInformation} object is retrieved.\r\n * @param tabInstanceParameters - OPTIONAL Ignored, kept for future use\r\n */\r\nexport function getMruTabInstances(\r\n callback: (tabInfo: TabInformation) => void,\r\n tabInstanceParameters?: TabInstanceParameters,\r\n): void {\r\n ensureInitialized();\r\n pages.tabs.getMruTabInstances(tabInstanceParameters).then((tabInfo: TabInformation) => {\r\n callback(tabInfo);\r\n });\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link pages.shareDeepLink pages.shareDeepLink(deepLinkParameters: DeepLinkParameters): void} instead.\r\n *\r\n * Shares a deep link that a user can use to navigate back to a specific state in this page.\r\n *\r\n * @param deepLinkParameters - ID and label for the link and fallback URL.\r\n */\r\nexport function shareDeepLink(deepLinkParameters: DeepLinkParameters): void {\r\n pages.shareDeepLink({\r\n subPageId: deepLinkParameters.subEntityId,\r\n subPageLabel: deepLinkParameters.subEntityLabel,\r\n subPageWebUrl: deepLinkParameters.subEntityWebUrl,\r\n });\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link app.openLink core.openLink(deepLink: string): Promise\\} instead.\r\n *\r\n * Execute deep link API.\r\n *\r\n * @param deepLink - deep link.\r\n */\r\nexport function executeDeepLink(deepLink: string, onComplete?: (status: boolean, reason?: string) => void): void {\r\n ensureInitialized(\r\n FrameContexts.content,\r\n FrameContexts.sidePanel,\r\n FrameContexts.settings,\r\n FrameContexts.task,\r\n FrameContexts.stage,\r\n FrameContexts.meetingStage,\r\n );\r\n onComplete = onComplete ? onComplete : getGenericOnCompleteHandler();\r\n app\r\n .openLink(deepLink)\r\n .then(() => {\r\n onComplete(true);\r\n })\r\n .catch((err: Error) => {\r\n onComplete(false, err.message);\r\n });\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link pages.setCurrentFrame pages.setCurrentFrame(frameInfo: FrameInfo): void} instead.\r\n *\r\n * Set the current Frame Context\r\n *\r\n * @param frameContext - FrameContext information to be set\r\n */\r\nexport function setFrameContext(frameContext: FrameContext): void {\r\n pages.setCurrentFrame(frameContext);\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link pages.initializeWithFrameContext pages.initializeWithFrameContext(frameInfo: FrameInfo, callback?: () => void, validMessageOrigins?: string[],): void} instead.\r\n *\r\n * Initilize with FrameContext\r\n *\r\n * @param frameContext - FrameContext information to be set\r\n * @param callback - The optional callback to be invoked be invoked after initilizing the frame context\r\n * @param validMessageOrigins - Optionally specify a list of cross frame message origins.\r\n * They must have https: protocol otherwise they will be ignored. Example: https:www.example.com\r\n */\r\nexport function initializeWithFrameContext(\r\n frameContext: FrameContext,\r\n callback?: () => void,\r\n validMessageOrigins?: string[],\r\n): void {\r\n pages.initializeWithFrameContext(frameContext, callback, validMessageOrigins);\r\n}\r\n\r\n/**\r\n * Transforms the app.Context object received to the legacy global Context object\r\n * @param appContext - The app.Context object to be transformed\r\n * @returns The transformed legacy global Context object\r\n */\r\nfunction transformAppContextToLegacyContext(appContext: app.Context): Context {\r\n const context: Context = {\r\n // app\r\n locale: appContext.app.locale,\r\n appSessionId: appContext.app.sessionId,\r\n theme: appContext.app.theme,\r\n appIconPosition: appContext.app.iconPositionVertical,\r\n osLocaleInfo: appContext.app.osLocaleInfo,\r\n parentMessageId: appContext.app.parentMessageId,\r\n userClickTime: appContext.app.userClickTime,\r\n userFileOpenPreference: appContext.app.userFileOpenPreference,\r\n appLaunchId: appContext.app.appLaunchId,\r\n\r\n // app.host\r\n hostClientType: appContext.app.host.clientType,\r\n sessionId: appContext.app.host.sessionId,\r\n ringId: appContext.app.host.ringId,\r\n\r\n // page\r\n entityId: appContext.page.id,\r\n frameContext: appContext.page.frameContext,\r\n subEntityId: appContext.page.subPageId,\r\n isFullScreen: appContext.page.isFullScreen,\r\n isMultiWindow: appContext.page.isMultiWindow,\r\n sourceOrigin: appContext.page.sourceOrigin,\r\n\r\n // user\r\n userObjectId: appContext.user !== undefined ? appContext.user.id : undefined,\r\n isCallingAllowed: appContext.user !== undefined ? appContext.user.isCallingAllowed : undefined,\r\n isPSTNCallingAllowed: appContext.user !== undefined ? appContext.user.isPSTNCallingAllowed : undefined,\r\n userLicenseType: appContext.user !== undefined ? appContext.user.licenseType : undefined,\r\n loginHint: appContext.user !== undefined ? appContext.user.loginHint : undefined,\r\n userPrincipalName: appContext.user !== undefined ? appContext.user.userPrincipalName : undefined,\r\n\r\n // user.tenant\r\n tid:\r\n appContext.user !== undefined\r\n ? appContext.user.tenant !== undefined\r\n ? appContext.user.tenant.id\r\n : undefined\r\n : undefined,\r\n tenantSKU:\r\n appContext.user !== undefined\r\n ? appContext.user.tenant !== undefined\r\n ? appContext.user.tenant.teamsSku\r\n : undefined\r\n : undefined,\r\n\r\n // channel\r\n channelId: appContext.channel !== undefined ? appContext.channel.id : undefined,\r\n channelName: appContext.channel !== undefined ? appContext.channel.displayName : undefined,\r\n channelRelativeUrl: appContext.channel !== undefined ? appContext.channel.relativeUrl : undefined,\r\n channelType: appContext.channel !== undefined ? appContext.channel.membershipType : undefined,\r\n defaultOneNoteSectionId: appContext.channel !== undefined ? appContext.channel.defaultOneNoteSectionId : undefined,\r\n hostTeamGroupId: appContext.channel !== undefined ? appContext.channel.ownerGroupId : undefined,\r\n hostTeamTenantId: appContext.channel !== undefined ? appContext.channel.ownerTenantId : undefined,\r\n\r\n // chat\r\n chatId: appContext.chat !== undefined ? appContext.chat.id : undefined,\r\n\r\n // meeting\r\n meetingId: appContext.meeting !== undefined ? appContext.meeting.id : undefined,\r\n\r\n // sharepoint\r\n sharepoint: appContext.sharepoint,\r\n\r\n // team\r\n teamId: appContext.team !== undefined ? appContext.team.internalId : undefined,\r\n teamName: appContext.team !== undefined ? appContext.team.displayName : undefined,\r\n teamType: appContext.team !== undefined ? appContext.team.type : undefined,\r\n groupId: appContext.team !== undefined ? appContext.team.groupId : undefined,\r\n teamTemplateId: appContext.team !== undefined ? appContext.team.templateId : undefined,\r\n isTeamArchived: appContext.team !== undefined ? appContext.team.isArchived : undefined,\r\n userTeamRole: appContext.team !== undefined ? appContext.team.userRole : undefined,\r\n\r\n // sharepointSite\r\n teamSiteUrl: appContext.sharePointSite !== undefined ? appContext.sharePointSite.teamSiteUrl : undefined,\r\n teamSiteDomain: appContext.sharePointSite !== undefined ? appContext.sharePointSite.teamSiteDomain : undefined,\r\n teamSitePath: appContext.sharePointSite !== undefined ? appContext.sharePointSite.teamSitePath : undefined,\r\n teamSiteId: appContext.sharePointSite !== undefined ? appContext.sharePointSite.teamSiteId : undefined,\r\n mySitePath: appContext.sharePointSite !== undefined ? appContext.sharePointSite.mySitePath : undefined,\r\n mySiteDomain: appContext.sharePointSite !== undefined ? appContext.sharePointSite.mySiteDomain : undefined,\r\n };\r\n\r\n return context;\r\n}\r\n","import { ensureInitialized } from '../internal/internalAPIs';\r\nimport { getGenericOnCompleteHandler } from '../internal/utils';\r\nimport { FrameContexts } from './constants';\r\nimport { TabInstance } from './interfaces';\r\nimport { pages } from './pages';\r\n/**\r\n * Navigation specific part of the SDK.\r\n */\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link pages.returnFocus pages.returnFocus(navigateForward?: boolean): void} instead.\r\n *\r\n * Return focus to the main Teams app. Will focus search bar if navigating foward and app bar if navigating back.\r\n *\r\n * @param navigateForward - Determines the direction to focus in teams app.\r\n */\r\nexport function returnFocus(navigateForward?: boolean): void {\r\n pages.returnFocus(navigateForward);\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link pages.tabs.navigateToTab pages.tabs.navigateToTab(tabInstance: TabInstance): Promise\\} instead.\r\n *\r\n * Navigates the Microsoft Teams app to the specified tab instance.\r\n *\r\n * @param tabInstance - The tab instance to navigate to.\r\n * @param onComplete - The callback to invoke when the action is complete.\r\n */\r\nexport function navigateToTab(tabInstance: TabInstance, onComplete?: (status: boolean, reason?: string) => void): void {\r\n ensureInitialized();\r\n onComplete = onComplete ? onComplete : getGenericOnCompleteHandler();\r\n pages.tabs\r\n .navigateToTab(tabInstance)\r\n .then(() => {\r\n onComplete(true);\r\n })\r\n .catch((error: Error) => {\r\n onComplete(false, error.message);\r\n });\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link pages.navigateCrossDomain pages.navigateCrossDomain(url: string): Promise\\} instead.\r\n *\r\n * Navigates the frame to a new cross-domain URL. The domain of this URL must match at least one of the\r\n * valid domains specified in the validDomains block of the manifest; otherwise, an exception will be\r\n * thrown. This function needs to be used only when navigating the frame to a URL in a different domain\r\n * than the current one in a way that keeps the app informed of the change and allows the SDK to\r\n * continue working.\r\n *\r\n * @param url - The URL to navigate the frame to.\r\n * @param onComplete - The callback to invoke when the action is complete.\r\n */\r\nexport function navigateCrossDomain(url: string, onComplete?: (status: boolean, reason?: string) => void): void {\r\n ensureInitialized(\r\n FrameContexts.content,\r\n FrameContexts.sidePanel,\r\n FrameContexts.settings,\r\n FrameContexts.remove,\r\n FrameContexts.task,\r\n FrameContexts.stage,\r\n FrameContexts.meetingStage,\r\n );\r\n onComplete = onComplete ? onComplete : getGenericOnCompleteHandler();\r\n pages\r\n .navigateCrossDomain(url)\r\n .then(() => {\r\n onComplete(true);\r\n })\r\n .catch((error: Error) => {\r\n onComplete(false, error.message);\r\n });\r\n}\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link pages.backStack.navigateBack pages.backStack.navigateBack(): Promise\\} instead.\r\n *\r\n * Navigates back in the Teams client.\r\n * See registerBackButtonHandler for more information on when it's appropriate to use this method.\r\n *\r\n * @param onComplete - The callback to invoke when the action is complete.\r\n */\r\nexport function navigateBack(onComplete?: (status: boolean, reason?: string) => void): void {\r\n ensureInitialized();\r\n onComplete = onComplete ? onComplete : getGenericOnCompleteHandler();\r\n pages.backStack\r\n .navigateBack()\r\n .then(() => {\r\n onComplete(true);\r\n })\r\n .catch((error: Error) => {\r\n onComplete(false, error.message);\r\n });\r\n}\r\n","/* eslint-disable @typescript-eslint/ban-types */\r\n\r\nimport { sendMessageToParent } from '../internal/communication';\r\nimport { ensureInitialized } from '../internal/internalAPIs';\r\nimport { ChildAppWindow, IAppWindow } from './appWindow';\r\nimport { FrameContexts, TaskModuleDimension } from './constants';\r\nimport { dialog } from './dialog';\r\nimport { BotUrlDialogInfo, DialogInfo, DialogSize, TaskInfo, UrlDialogInfo } from './interfaces';\r\n\r\n/**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link dialog} namespace instead.\r\n *\r\n * Namespace to interact with the task module-specific part of the SDK.\r\n * This object is usable only on the content frame.\r\n * The tasks namespace will be deprecated. Please use dialog for future developments.\r\n */\r\nexport namespace tasks {\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link dialog.open(urlDialogInfo: UrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): PostMessageChannel} for url based dialogs\r\n * and {@link dialog.bot.open(botUrlDialogInfo: BotUrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): PostMessageChannel} for bot based dialogs.\r\n *\r\n * Allows an app to open the task module.\r\n *\r\n * @param taskInfo - An object containing the parameters of the task module\r\n * @param submitHandler - Handler to call when the task module is completed\r\n */\r\n export function startTask(\r\n taskInfo: TaskInfo,\r\n submitHandler?: (err: string, result: string | object) => void,\r\n ): IAppWindow {\r\n if (taskInfo.card !== undefined || taskInfo.url === undefined) {\r\n ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\r\n sendMessageToParent('tasks.startTask', [taskInfo as DialogInfo], submitHandler);\r\n } else if (taskInfo.completionBotId !== undefined) {\r\n dialog.bot.open(getBotUrlDialogInfoFromTaskInfo(taskInfo), (sdkResponse: dialog.ISdkResponse) =>\r\n submitHandler(sdkResponse.err, sdkResponse.result),\r\n );\r\n } else {\r\n dialog.open(getUrlDialogInfoFromTaskInfo(taskInfo), (sdkResponse: dialog.ISdkResponse) =>\r\n submitHandler(sdkResponse.err, sdkResponse.result),\r\n );\r\n }\r\n return new ChildAppWindow();\r\n }\r\n\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link dialog.update.resize dialog.update.resize(dimensions: DialogSize): void} instead.\r\n *\r\n * Update height/width task info properties.\r\n *\r\n * @param taskInfo - An object containing width and height properties\r\n */\r\n export function updateTask(taskInfo: TaskInfo): void {\r\n taskInfo = getDefaultSizeIfNotProvided(taskInfo);\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { width, height, ...extra } = taskInfo;\r\n\r\n if (Object.keys(extra).length) {\r\n throw new Error('resize requires a TaskInfo argument containing only width and height');\r\n }\r\n dialog.update.resize(taskInfo as DialogSize);\r\n }\r\n\r\n /**\r\n * @deprecated\r\n * As of 2.0.0, please use {@link dialog.submit dialog.submit(result?: string | object, appIds?: string | string[]): void} instead.\r\n *\r\n * Submit the task module.\r\n *\r\n * @param result - Contains the result to be sent to the bot or the app. Typically a JSON object or a serialized version of it\r\n * @param appIds - Helps to validate that the call originates from the same appId as the one that invoked the task module\r\n */\r\n export function submitTask(result?: string | object, appIds?: string | string[]): void {\r\n dialog.submit(result, appIds);\r\n }\r\n\r\n export function getUrlDialogInfoFromTaskInfo(taskInfo: TaskInfo): UrlDialogInfo {\r\n const urldialogInfo: UrlDialogInfo = {\r\n url: taskInfo.url,\r\n size: {\r\n height: taskInfo.height ? taskInfo.height : TaskModuleDimension.Small,\r\n width: taskInfo.width ? taskInfo.width : TaskModuleDimension.Small,\r\n },\r\n title: taskInfo.title,\r\n fallbackUrl: taskInfo.fallbackUrl,\r\n };\r\n return urldialogInfo;\r\n }\r\n\r\n export function getBotUrlDialogInfoFromTaskInfo(taskInfo: TaskInfo): BotUrlDialogInfo {\r\n const botUrldialogInfo: BotUrlDialogInfo = {\r\n url: taskInfo.url,\r\n size: {\r\n height: taskInfo.height ? taskInfo.height : TaskModuleDimension.Small,\r\n width: taskInfo.width ? taskInfo.width : TaskModuleDimension.Small,\r\n },\r\n title: taskInfo.title,\r\n fallbackUrl: taskInfo.fallbackUrl,\r\n completionBotId: taskInfo.completionBotId,\r\n };\r\n return botUrldialogInfo;\r\n }\r\n export function getDefaultSizeIfNotProvided(taskInfo: TaskInfo): TaskInfo {\r\n taskInfo.height = taskInfo.height ? taskInfo.height : TaskModuleDimension.Small;\r\n taskInfo.width = taskInfo.width ? taskInfo.width : TaskModuleDimension.Small;\r\n return taskInfo;\r\n }\r\n}\r\n","import { sendMessageToParent } from '../internal/communication';\r\nimport { ensureInitialized } from '../internal/internalAPIs';\r\nimport { FileOpenPreference, FrameContexts, SdkError } from '../public';\r\n\r\n/**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Namespace to interact with the files specific part of the SDK.\r\n */\r\nexport namespace files {\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Cloud storage providers registered with Microsoft Teams\r\n */\r\n export enum CloudStorageProvider {\r\n Dropbox = 'DROPBOX',\r\n Box = 'BOX',\r\n Sharefile = 'SHAREFILE',\r\n GoogleDrive = 'GOOGLEDRIVE',\r\n Egnyte = 'EGNYTE',\r\n SharePoint = 'SharePoint',\r\n }\r\n interface IWopiThumbnail {\r\n size: number;\r\n url: string;\r\n }\r\n\r\n interface IWopiService {\r\n name: string;\r\n description: string;\r\n thumbnails: IWopiThumbnail[];\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n *\r\n * External third-party cloud storages providers interface\r\n */\r\n export interface IExternalProvider extends IWopiService {\r\n providerType: CloudStorageProviderType;\r\n providerCode: CloudStorageProvider;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n *\r\n * Cloud storage provider type enums\r\n */\r\n export enum CloudStorageProviderType {\r\n Sharepoint = 0,\r\n WopiIntegration,\r\n Google,\r\n OneDrive,\r\n Recent,\r\n Aggregate,\r\n FileSystem, // Used for Downloaded files on Desktop\r\n Search, // Used by P2P files with OSearch\r\n AllFiles, // Used by P2P files with AllFiles API\r\n SharedWithMe,\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n *\r\n * Cloud storage folder interface\r\n */\r\n export interface CloudStorageFolder {\r\n /**\r\n * @hidden\r\n * ID of the cloud storage folder\r\n */\r\n id: string;\r\n /**\r\n * @hidden\r\n * Display Name/Title of the cloud storage folder\r\n */\r\n title: string;\r\n /**\r\n * @hidden\r\n * ID of the cloud storage folder in the provider\r\n */\r\n folderId: string;\r\n /**\r\n * @hidden\r\n * Type of the cloud storage folder provider integration\r\n */\r\n providerType: CloudStorageProviderType;\r\n /**\r\n * @hidden\r\n * Code of the supported cloud storage folder provider\r\n */\r\n providerCode: CloudStorageProvider;\r\n /**\r\n * @hidden\r\n * Display name of the owner of the cloud storage folder provider\r\n */\r\n ownerDisplayName: string;\r\n /**\r\n * @hidden\r\n * Sharepoint specific siteURL of the folder\r\n */\r\n siteUrl?: string;\r\n /**\r\n * @hidden\r\n * Sharepoint specific serverRelativeUrl of the folder\r\n */\r\n serverRelativeUrl?: string;\r\n /**\r\n * @hidden\r\n * Sharepoint specific libraryType of the folder\r\n */\r\n libraryType?: string;\r\n /**\r\n * @hidden\r\n * Sharepoint specific accessType of the folder\r\n */\r\n accessType?: string;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n *\r\n * Cloud storage item interface\r\n */\r\n export interface CloudStorageFolderItem {\r\n /**\r\n * @hidden\r\n * ID of the item in the provider\r\n */\r\n id: string;\r\n /**\r\n * @hidden\r\n * Display name/title\r\n */\r\n title: string;\r\n /**\r\n * @hidden\r\n * Key to differentiate files and subdirectory\r\n */\r\n isSubdirectory: boolean;\r\n /**\r\n * @hidden\r\n * File extension\r\n */\r\n type: string;\r\n /**\r\n * @hidden\r\n * Last modifed time of the item\r\n */\r\n lastModifiedTime: string;\r\n /**\r\n * @hidden\r\n * Display size of the items in bytes\r\n */\r\n size: number;\r\n /**\r\n * @hidden\r\n * URL of the file\r\n */\r\n objectUrl: string;\r\n /**\r\n * @hidden\r\n * Temporary access token for the item\r\n */\r\n accessToken?: string;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n *\r\n * Files entity user interface\r\n */\r\n export interface IFilesEntityUser {\r\n /**\r\n * User name.\r\n */\r\n displayName: string;\r\n /**\r\n * User email.\r\n */\r\n email: string;\r\n\r\n /**\r\n * User MRI.\r\n */\r\n mri: string;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n *\r\n * Special Document Library enum\r\n */\r\n export enum SpecialDocumentLibraryType {\r\n ClassMaterials = 'classMaterials',\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n *\r\n * Document Library Access enum\r\n */\r\n export enum DocumentLibraryAccessType {\r\n Readonly = 'readonly',\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n *\r\n * SharePoint file interface\r\n */\r\n export interface ISharePointFile {\r\n siteId?: string;\r\n siteUrl: string;\r\n objectId: string;\r\n objectUrl: string;\r\n openInWindowFileUrl: string;\r\n title: string;\r\n isFolder: boolean;\r\n serverRelativeUrl: string;\r\n lastModifiedByUser: IFilesEntityUser;\r\n lastModifiedTime: string;\r\n sentByUser: IFilesEntityUser;\r\n createdByUser: IFilesEntityUser;\r\n createdTime: string;\r\n size: number;\r\n type: string;\r\n spItemUrl?: string;\r\n libraryType?: SpecialDocumentLibraryType;\r\n accessType?: DocumentLibraryAccessType;\r\n etag?: string;\r\n remoteItem?: string;\r\n listUrl?: string;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n *\r\n * Download status enum\r\n */\r\n export enum FileDownloadStatus {\r\n Downloaded = 'Downloaded',\r\n Downloading = 'Downloading',\r\n Failed = 'Failed',\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n *\r\n * Download Files interface\r\n */\r\n export interface IFileItem {\r\n /**\r\n * ID of the file metadata\r\n */\r\n objectId?: string;\r\n /**\r\n * Path of the file\r\n */\r\n path?: string;\r\n /**\r\n * Size of the file in bytes\r\n */\r\n sizeInBytes?: number;\r\n /**\r\n * Download status\r\n */\r\n status?: FileDownloadStatus;\r\n /**\r\n * Download timestamp\r\n */\r\n timestamp: Date;\r\n /**\r\n * File name\r\n */\r\n title: string;\r\n /**\r\n * Type of file i.e. the file extension.\r\n */\r\n extension: string;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n *\r\n * Gets a list of cloud storage folders added to the channel\r\n * @param channelId - ID of the channel whose cloud storage folders should be retrieved\r\n * @param callback - Callback that will be triggered post folders load\r\n */\r\n export function getCloudStorageFolders(\r\n channelId: string,\r\n callback: (error: SdkError, folders: CloudStorageFolder[]) => void,\r\n ): void {\r\n ensureInitialized(FrameContexts.content);\r\n\r\n if (!channelId || channelId.length === 0) {\r\n throw new Error('[files.getCloudStorageFolders] channelId name cannot be null or empty');\r\n }\r\n if (!callback) {\r\n throw new Error('[files.getCloudStorageFolders] Callback cannot be null');\r\n }\r\n\r\n sendMessageToParent('files.getCloudStorageFolders', [channelId], callback);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Initiates the add cloud storage folder flow\r\n *\r\n * @param channelId - ID of the channel to add cloud storage folder\r\n * @param callback - Callback that will be triggered post add folder flow is compelete\r\n */\r\n export function addCloudStorageFolder(\r\n channelId: string,\r\n callback: (error: SdkError, isFolderAdded: boolean, folders: CloudStorageFolder[]) => void,\r\n ): void {\r\n ensureInitialized(FrameContexts.content);\r\n\r\n if (!channelId || channelId.length === 0) {\r\n throw new Error('[files.addCloudStorageFolder] channelId name cannot be null or empty');\r\n }\r\n if (!callback) {\r\n throw new Error('[files.addCloudStorageFolder] Callback cannot be null');\r\n }\r\n\r\n sendMessageToParent('files.addCloudStorageFolder', [channelId], callback);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n *\r\n * Deletes a cloud storage folder from channel\r\n *\r\n * @param channelId - ID of the channel where folder is to be deleted\r\n * @param folderToDelete - cloud storage folder to be deleted\r\n * @param callback - Callback that will be triggered post delete\r\n */\r\n export function deleteCloudStorageFolder(\r\n channelId: string,\r\n folderToDelete: CloudStorageFolder,\r\n callback: (error: SdkError, isFolderDeleted: boolean) => void,\r\n ): void {\r\n ensureInitialized(FrameContexts.content);\r\n\r\n if (!channelId) {\r\n throw new Error('[files.deleteCloudStorageFolder] channelId name cannot be null or empty');\r\n }\r\n if (!folderToDelete) {\r\n throw new Error('[files.deleteCloudStorageFolder] folderToDelete cannot be null or empty');\r\n }\r\n if (!callback) {\r\n throw new Error('[files.deleteCloudStorageFolder] Callback cannot be null');\r\n }\r\n\r\n sendMessageToParent('files.deleteCloudStorageFolder', [channelId, folderToDelete], callback);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n *\r\n * Fetches the contents of a Cloud storage folder (CloudStorageFolder) / sub directory\r\n *\r\n * @param folder - Cloud storage folder (CloudStorageFolder) / sub directory (CloudStorageFolderItem)\r\n * @param providerCode - Code of the cloud storage folder provider\r\n * @param callback - Callback that will be triggered post contents are loaded\r\n */\r\n export function getCloudStorageFolderContents(\r\n folder: CloudStorageFolder | CloudStorageFolderItem,\r\n providerCode: CloudStorageProvider,\r\n callback: (error: SdkError, items: CloudStorageFolderItem[]) => void,\r\n ): void {\r\n ensureInitialized(FrameContexts.content);\r\n\r\n if (!folder || !providerCode) {\r\n throw new Error('[files.getCloudStorageFolderContents] folder/providerCode name cannot be null or empty');\r\n }\r\n\r\n if (!callback) {\r\n throw new Error('[files.getCloudStorageFolderContents] Callback cannot be null');\r\n }\r\n\r\n if ('isSubdirectory' in folder && !folder.isSubdirectory) {\r\n throw new Error('[files.getCloudStorageFolderContents] provided folder is not a subDirectory');\r\n }\r\n\r\n sendMessageToParent('files.getCloudStorageFolderContents', [folder, providerCode], callback);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n *\r\n * Open a cloud storage file in Teams\r\n *\r\n * @param file - cloud storage file that should be opened\r\n * @param providerCode - Code of the cloud storage folder provider\r\n * @param fileOpenPreference - Whether file should be opened in web/inline\r\n */\r\n export function openCloudStorageFile(\r\n file: CloudStorageFolderItem,\r\n providerCode: CloudStorageProvider,\r\n fileOpenPreference?: FileOpenPreference.Web | FileOpenPreference.Inline,\r\n ): void {\r\n ensureInitialized(FrameContexts.content);\r\n\r\n if (!file || !providerCode) {\r\n throw new Error('[files.openCloudStorageFile] file/providerCode cannot be null or empty');\r\n }\r\n\r\n if (file.isSubdirectory) {\r\n throw new Error('[files.openCloudStorageFile] provided file is a subDirectory');\r\n }\r\n\r\n sendMessageToParent('files.openCloudStorageFile', [file, providerCode, fileOpenPreference]);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Allow 1st party apps to call this function to get the external\r\n * third party cloud storage accounts that the tenant supports\r\n * @param excludeAddedProviders: return a list of support third party\r\n * cloud storages that hasn't been added yet.\r\n */\r\n export function getExternalProviders(\r\n excludeAddedProviders = false,\r\n callback: (error: SdkError, providers: IExternalProvider[]) => void,\r\n ): void {\r\n ensureInitialized(FrameContexts.content);\r\n\r\n if (!callback) {\r\n throw new Error('[files.getExternalProviders] Callback cannot be null');\r\n }\r\n\r\n sendMessageToParent('files.getExternalProviders', [excludeAddedProviders], callback);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Allow 1st party apps to call this function to move files\r\n * among SharePoint and third party cloud storages.\r\n */\r\n export function copyMoveFiles(\r\n selectedFiles: CloudStorageFolderItem[] | ISharePointFile[],\r\n providerCode: CloudStorageProvider,\r\n destinationFolder: CloudStorageFolderItem | ISharePointFile,\r\n destinationProviderCode: CloudStorageProvider,\r\n isMove = false,\r\n callback: (error?: SdkError) => void,\r\n ): void {\r\n ensureInitialized(FrameContexts.content);\r\n if (!selectedFiles || selectedFiles.length === 0) {\r\n throw new Error('[files.copyMoveFiles] selectedFiles cannot be null or empty');\r\n }\r\n if (!providerCode) {\r\n throw new Error('[files.copyMoveFiles] providerCode cannot be null or empty');\r\n }\r\n if (!destinationFolder) {\r\n throw new Error('[files.copyMoveFiles] destinationFolder cannot be null or empty');\r\n }\r\n if (!destinationProviderCode) {\r\n throw new Error('[files.copyMoveFiles] destinationProviderCode cannot be null or empty');\r\n }\r\n if (!callback) {\r\n throw new Error('[files.copyMoveFiles] callback cannot be null');\r\n }\r\n sendMessageToParent(\r\n 'files.copyMoveFiles',\r\n [selectedFiles, providerCode, destinationFolder, destinationProviderCode, isMove],\r\n callback,\r\n );\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n *\r\n * Gets list of downloads for current user\r\n * @param callback Callback that will be triggered post downloads load\r\n */\r\n export function getFileDownloads(callback: (error?: SdkError, files?: IFileItem[]) => void): void {\r\n ensureInitialized(FrameContexts.content);\r\n\r\n if (!callback) {\r\n throw new Error('[files.getFileDownloads] Callback cannot be null');\r\n }\r\n\r\n sendMessageToParent('files.getFileDownloads', [], callback);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n *\r\n * Open download preference folder if fileObjectId value is undefined else open folder containing the file with id fileObjectId\r\n * @param fileObjectId - Id of the file whose containing folder should be opened\r\n * @param callback Callback that will be triggered post open download folder/path\r\n */\r\n export function openDownloadFolder(fileObjectId: string = undefined, callback: (error?: SdkError) => void): void {\r\n ensureInitialized(FrameContexts.content);\r\n\r\n if (!callback) {\r\n throw new Error('[files.openDownloadFolder] Callback cannot be null');\r\n }\r\n\r\n sendMessageToParent('files.openDownloadFolder', [fileObjectId], callback);\r\n }\r\n}\r\n","import { sendAndHandleSdkError } from '../internal/communication';\r\nimport { registerHandler } from '../internal/handlers';\r\nimport { ensureInitialized } from '../internal/internalAPIs';\r\nimport { errorNotSupportedOnPlatform } from '../public/constants';\r\nimport { runtime } from '../public/runtime';\r\n\r\nexport namespace meetingRoom {\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Data structure to represent a meeting room.\r\n */\r\n export interface MeetingRoomInfo {\r\n /**\r\n * @hidden\r\n * Endpoint id of the meeting room.\r\n */\r\n endpointId: string;\r\n /**\r\n * @hidden\r\n * Device name of the meeting room.\r\n */\r\n deviceName: string;\r\n /**\r\n * @hidden\r\n * Client type of the meeting room.\r\n */\r\n clientType: string;\r\n /**\r\n * @hidden\r\n * Client version of the meeting room.\r\n */\r\n clientVersion: string;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Type of Media control capabilities of a meeting room.\r\n */\r\n type MediaControls = 'toggleMute' | 'toggleCamera' | 'toggleCaptions' | 'volume';\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Types of Stage Layout control capabilities of a meeting room.\r\n */\r\n\r\n type StageLayoutControls =\r\n | 'showVideoGallery'\r\n | 'showContent'\r\n | 'showVideoGalleryAndContent'\r\n | 'showLargeGallery'\r\n | 'showTogether';\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Types of Meeting Control capabilities of a meeting room.\r\n */\r\n\r\n type MeetingControls = 'leaveMeeting';\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Types of Stage Layout State of a meeting room.\r\n */\r\n\r\n type StageLayoutStates = 'Gallery' | 'Content + gallery' | 'Content' | 'Large gallery' | 'Together mode';\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Data structure to represent capabilities of a meeting room.\r\n */\r\n export interface MeetingRoomCapability {\r\n /**\r\n * @hidden\r\n * Media control capabilities, value can be \"toggleMute\", \"toggleCamera\", \"toggleCaptions\", \"volume\".\r\n */\r\n mediaControls: MediaControls[];\r\n /**\r\n * @hidden\r\n * Main stage layout control capabilities, value can be \"showVideoGallery\", \"showContent\", \"showVideoGalleryAndContent\", \"showLargeGallery\", \"showTogether\".\r\n */\r\n stageLayoutControls: StageLayoutControls[];\r\n /**\r\n * @hidden\r\n * Meeting control capabilities, value can be \"leaveMeeting\".\r\n */\r\n meetingControls: MeetingControls[];\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Data structure to represent states of a meeting room.\r\n */\r\n export interface MeetingRoomState {\r\n /**\r\n * @hidden\r\n * Current mute state, true: mute, false: unmute.\r\n */\r\n toggleMute: boolean;\r\n /**\r\n * @hidden\r\n * Current camera state, true: camera on, false: camera off.\r\n */\r\n toggleCamera: boolean;\r\n /**\r\n * @hidden\r\n * Current captions state, true: captions on, false: captions off.\r\n */\r\n toggleCaptions: boolean;\r\n /**\r\n * @hidden\r\n * Current main stage layout state, value can be one of \"Gallery\", \"Content + gallery\", \"Content\", \"Large gallery\" and \"Together mode\".\r\n */\r\n stageLayout: StageLayoutStates;\r\n /**\r\n * @hidden\r\n * Current leaveMeeting state, true: leave, false: no-op.\r\n */\r\n leaveMeeting: boolean;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Fetch the meeting room info that paired with current client.\r\n *\r\n * @returns Promise resolved with meeting room info or rejected with SdkError value\r\n */\r\n export function getPairedMeetingRoomInfo(): Promise {\r\n return new Promise(resolve => {\r\n ensureInitialized();\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n resolve(sendAndHandleSdkError('meetingRoom.getPairedMeetingRoomInfo'));\r\n });\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Send a command to paired meeting room.\r\n *\r\n * @param commandName The command name.\r\n * @returns Promise resolved upon completion or rejected with SdkError value\r\n */\r\n export function sendCommandToPairedMeetingRoom(commandName: string): Promise {\r\n return new Promise(resolve => {\r\n if (!commandName || commandName.length == 0) {\r\n throw new Error('[meetingRoom.sendCommandToPairedMeetingRoom] Command name cannot be null or empty');\r\n }\r\n ensureInitialized();\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n resolve(sendAndHandleSdkError('meetingRoom.sendCommandToPairedMeetingRoom', commandName));\r\n });\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Registers a handler for meeting room capabilities update.\r\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\r\n *\r\n * @param handler The handler to invoke when the capabilities of meeting room update.\r\n */\r\n export function registerMeetingRoomCapabilitiesUpdateHandler(\r\n handler: (capabilities: MeetingRoomCapability) => void,\r\n ): void {\r\n if (!handler) {\r\n throw new Error('[meetingRoom.registerMeetingRoomCapabilitiesUpdateHandler] Handler cannot be null');\r\n }\r\n ensureInitialized();\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n registerHandler('meetingRoom.meetingRoomCapabilitiesUpdate', (capabilities: MeetingRoomCapability) => {\r\n ensureInitialized();\r\n handler(capabilities);\r\n });\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * Registers a handler for meeting room states update.\r\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\r\n *\r\n * @param handler The handler to invoke when the states of meeting room update.\r\n */\r\n export function registerMeetingRoomStatesUpdateHandler(handler: (states: MeetingRoomState) => void): void {\r\n if (!handler) {\r\n throw new Error('[meetingRoom.registerMeetingRoomStatesUpdateHandler] Handler cannot be null');\r\n }\r\n ensureInitialized();\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n registerHandler('meetingRoom.meetingRoomStatesUpdate', (states: MeetingRoomState) => {\r\n ensureInitialized();\r\n handler(states);\r\n });\r\n }\r\n\r\n export function isSupported(): boolean {\r\n return runtime.supports.meetingRoom ? true : false;\r\n }\r\n}\r\n","import { sendMessageToParent } from '../internal/communication';\r\nimport { ensureInitialized } from '../internal/internalAPIs';\r\nimport { errorNotSupportedOnPlatform, FrameContexts } from '../public/constants';\r\nimport { runtime } from '../public/runtime';\r\nimport { ShowNotificationParameters } from './interfaces';\r\n\r\nexport namespace notifications {\r\n /**\r\n * @hidden\r\n * Hide from docs.\r\n * ------\r\n * display notification API.\r\n *\r\n * @param message - Notification message.\r\n * @param notificationType - Notification type\r\n *\r\n * @internal\r\n */\r\n export function showNotification(showNotificationParameters: ShowNotificationParameters): void {\r\n ensureInitialized(FrameContexts.content);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n\r\n sendMessageToParent('notifications.showNotification', [showNotificationParameters]);\r\n }\r\n export function isSupported(): boolean {\r\n return runtime.supports.notifications ? true : false;\r\n }\r\n}\r\n","import { sendMessageToParent } from '../internal/communication';\r\nimport { registerHandler } from '../internal/handlers';\r\nimport { ensureInitialized } from '../internal/internalAPIs';\r\nimport { errorNotSupportedOnPlatform, FrameContexts } from '../public/constants';\r\nimport { SdkError } from '../public/interfaces';\r\nimport { runtime } from '../public/runtime';\r\n\r\nexport namespace remoteCamera {\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Data structure to represent patricipant details needed to request control of camera.\r\n */\r\n export interface Participant {\r\n /**\r\n * @hidden\r\n * Id of participant.\r\n */\r\n id: string;\r\n /**\r\n * @hidden\r\n * Display name of participant.\r\n */\r\n displayName?: string;\r\n /**\r\n * @hidden\r\n * Active indicates whether the participant's device is actively being controlled.\r\n */\r\n active?: boolean;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Enum used to indicate possible camera control commands.\r\n */\r\n export enum ControlCommand {\r\n Reset = 'Reset',\r\n ZoomIn = 'ZoomIn',\r\n ZoomOut = 'ZoomOut',\r\n PanLeft = 'PanLeft',\r\n PanRight = 'PanRight',\r\n TiltUp = 'TiltUp',\r\n TiltDown = 'TiltDown',\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Data structure to indicate the current state of the device.\r\n */\r\n export interface DeviceState {\r\n /**\r\n * @hidden\r\n * All operation are available to apply.\r\n */\r\n available: boolean;\r\n /**\r\n * @hidden\r\n * Either camera doesnt support to get state or It unable to apply command.\r\n */\r\n error: boolean;\r\n /**\r\n * @hidden\r\n * Reset max out or already applied. Client Disable Reset.\r\n */\r\n reset: boolean;\r\n /**\r\n * @hidden\r\n * ZoomIn maxed out.\r\n */\r\n zoomIn: boolean;\r\n /**\r\n * @hidden\r\n * ZoomOut maxed out.\r\n */\r\n zoomOut: boolean;\r\n /**\r\n * @hidden\r\n * PanLeft reached max left.\r\n */\r\n panLeft: boolean;\r\n /**\r\n * @hidden\r\n * PanRight reached max right.\r\n */\r\n panRight: boolean;\r\n /**\r\n * @hidden\r\n * TiltUp reached top.\r\n */\r\n tiltUp: boolean;\r\n /**\r\n * @hidden\r\n * TiltDown reached bottom.\r\n */\r\n tiltDown: boolean;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Enum used to indicate the reason for the error.\r\n */\r\n export enum ErrorReason {\r\n CommandResetError,\r\n CommandZoomInError,\r\n CommandZoomOutError,\r\n CommandPanLeftError,\r\n CommandPanRightError,\r\n CommandTiltUpError,\r\n CommandTiltDownError,\r\n SendDataError,\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Data structure to indicate the status of the current session.\r\n */\r\n export interface SessionStatus {\r\n /**\r\n * @hidden\r\n * Whether the far-end user is controlling a device.\r\n */\r\n inControl: boolean;\r\n /**\r\n * @hidden\r\n * Reason the control session was terminated.\r\n */\r\n terminatedReason?: SessionTerminatedReason;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Enum used to indicate the reason the session was terminated.\r\n */\r\n export enum SessionTerminatedReason {\r\n None,\r\n ControlDenied,\r\n ControlNoResponse,\r\n ControlBusy,\r\n AckTimeout,\r\n ControlTerminated,\r\n ControllerTerminated,\r\n DataChannelError,\r\n ControllerCancelled,\r\n ControlDisabled,\r\n ControlTerminatedToAllowOtherController,\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Fetch a list of the participants with controllable-cameras in a meeting.\r\n *\r\n * @param callback - Callback contains 2 parameters, error and participants.\r\n * error can either contain an error of type SdkError, incase of an error, or null when fetch is successful\r\n * participants can either contain an array of Participant objects, incase of a successful fetch or null when it fails\r\n * participants: object that contains an array of participants with controllable-cameras\r\n */\r\n export function getCapableParticipants(\r\n callback: (error: SdkError | null, participants: Participant[] | null) => void,\r\n ): void {\r\n if (!callback) {\r\n throw new Error('[remoteCamera.getCapableParticipants] Callback cannot be null');\r\n }\r\n ensureInitialized(FrameContexts.sidePanel);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n sendMessageToParent('remoteCamera.getCapableParticipants', callback);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Request control of a participant's camera.\r\n *\r\n * @param participant - Participant specifies the participant to send the request for camera control.\r\n * @param callback - Callback contains 2 parameters, error and requestResponse.\r\n * error can either contain an error of type SdkError, incase of an error, or null when fetch is successful\r\n * requestResponse can either contain the true/false value, incase of a successful request or null when it fails\r\n * requestResponse: True means request was accepted and false means request was denied\r\n */\r\n export function requestControl(\r\n participant: Participant,\r\n callback: (error: SdkError | null, requestResponse: boolean | null) => void,\r\n ): void {\r\n if (!participant) {\r\n throw new Error('[remoteCamera.requestControl] Participant cannot be null');\r\n }\r\n if (!callback) {\r\n throw new Error('[remoteCamera.requestControl] Callback cannot be null');\r\n }\r\n ensureInitialized(FrameContexts.sidePanel);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n sendMessageToParent('remoteCamera.requestControl', [participant], callback);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Send control command to the participant's camera.\r\n *\r\n * @param ControlCommand - ControlCommand specifies the command for controling the camera.\r\n * @param callback - Callback to invoke when the command response returns.\r\n */\r\n export function sendControlCommand(ControlCommand: ControlCommand, callback: (error: SdkError | null) => void): void {\r\n if (!ControlCommand) {\r\n throw new Error('[remoteCamera.sendControlCommand] ControlCommand cannot be null');\r\n }\r\n if (!callback) {\r\n throw new Error('[remoteCamera.sendControlCommand] Callback cannot be null');\r\n }\r\n ensureInitialized(FrameContexts.sidePanel);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n sendMessageToParent('remoteCamera.sendControlCommand', [ControlCommand], callback);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Terminate the remote session\r\n *\r\n * @param callback - Callback to invoke when the command response returns.\r\n */\r\n export function terminateSession(callback: (error: SdkError | null) => void): void {\r\n if (!callback) {\r\n throw new Error('[remoteCamera.terminateSession] Callback cannot be null');\r\n }\r\n ensureInitialized(FrameContexts.sidePanel);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n sendMessageToParent('remoteCamera.terminateSession', callback);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Registers a handler for change in participants with controllable-cameras.\r\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\r\n *\r\n * @param handler - The handler to invoke when the list of participants with controllable-cameras changes.\r\n */\r\n export function registerOnCapableParticipantsChangeHandler(\r\n handler: (participantChange: Participant[]) => void,\r\n ): void {\r\n if (!handler) {\r\n throw new Error('[remoteCamera.registerOnCapableParticipantsChangeHandler] Handler cannot be null');\r\n }\r\n ensureInitialized(FrameContexts.sidePanel);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n registerHandler('remoteCamera.capableParticipantsChange', handler);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Registers a handler for error.\r\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\r\n *\r\n * @param handler - The handler to invoke when there is an error from the camera handler.\r\n */\r\n export function registerOnErrorHandler(handler: (error: ErrorReason) => void): void {\r\n if (!handler) {\r\n throw new Error('[remoteCamera.registerOnErrorHandler] Handler cannot be null');\r\n }\r\n ensureInitialized(FrameContexts.sidePanel);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n registerHandler('remoteCamera.handlerError', handler);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Registers a handler for device state change.\r\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\r\n *\r\n * @param handler - The handler to invoke when the controlled device changes state.\r\n */\r\n export function registerOnDeviceStateChangeHandler(handler: (deviceStateChange: DeviceState) => void): void {\r\n if (!handler) {\r\n throw new Error('[remoteCamera.registerOnDeviceStateChangeHandler] Handler cannot be null');\r\n }\r\n ensureInitialized(FrameContexts.sidePanel);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n registerHandler('remoteCamera.deviceStateChange', handler);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Registers a handler for session status change.\r\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\r\n *\r\n * @param handler - The handler to invoke when the current session status changes.\r\n */\r\n export function registerOnSessionStatusChangeHandler(handler: (sessionStatusChange: SessionStatus) => void): void {\r\n if (!handler) {\r\n throw new Error('[remoteCamera.registerOnSessionStatusChangeHandler] Handler cannot be null');\r\n }\r\n ensureInitialized(FrameContexts.sidePanel);\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n registerHandler('remoteCamera.sessionStatusChange', handler);\r\n }\r\n\r\n export function isSupported(): boolean {\r\n return runtime.supports.remoteCamera ? true : false;\r\n }\r\n}\r\n","import { sendMessageToParent } from '../internal/communication';\r\nimport { ensureInitialized } from '../internal/internalAPIs';\r\nimport { FrameContexts, SdkError } from '../public';\r\nimport { errorNotSupportedOnPlatform } from '../public/constants';\r\nimport { runtime } from '../public/runtime';\r\n/**\r\n * @hidden\r\n * Namespace to interact with the application entities specific part of the SDK.\r\n */\r\nexport namespace appEntity {\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * --------\r\n * Information on an app entity\r\n */\r\n export interface AppEntity {\r\n /**\r\n * @hidden\r\n * ID of the application\r\n */\r\n appId: string;\r\n\r\n /**\r\n * @hidden\r\n * URL for the application's icon\r\n */\r\n appIconUrl: string;\r\n\r\n /**\r\n * @hidden\r\n * Content URL for the app entity\r\n */\r\n contentUrl: string;\r\n\r\n /**\r\n * @hidden\r\n * The display name for the app entity\r\n */\r\n displayName: string;\r\n\r\n /**\r\n * @hidden\r\n * Website URL for the app entity. It is meant to be opened by the user in a browser.\r\n */\r\n websiteUrl: string;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * --------\r\n * Open the Tab Gallery and retrieve the app entity\r\n * @param threadId ID of the thread where the app entity will be created\r\n * @param categories A list of application categories that will be displayed in the opened tab gallery\r\n * @param subEntityId An object that will be made available to the application being configured\r\n * through the Context's subEntityId field.\r\n * @param callback Callback that will be triggered once the app entity information is available.\r\n * The callback takes two arguments: an SdkError in case something happened (i.e.\r\n * no permissions to execute the API) and the app entity configuration, if available\r\n */\r\n export function selectAppEntity(\r\n threadId: string,\r\n categories: string[],\r\n subEntityId: string,\r\n callback: (sdkError?: SdkError, appEntity?: AppEntity) => void,\r\n ): void {\r\n ensureInitialized(FrameContexts.content);\r\n\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n\r\n if (!threadId || threadId.length == 0) {\r\n throw new Error('[appEntity.selectAppEntity] threadId name cannot be null or empty');\r\n }\r\n\r\n if (!callback) {\r\n throw new Error('[appEntity.selectAppEntity] Callback cannot be null');\r\n }\r\n\r\n sendMessageToParent('appEntity.selectAppEntity', [threadId, categories, subEntityId], callback);\r\n }\r\n\r\n /**\r\n * Checks if appEntity capability is supported by the host\r\n * @returns true if the appEntity capability is enabled in runtime.supports.appEntity and\r\n * false if it is disabled\r\n */\r\n export function isSupported(): boolean {\r\n return runtime.supports.appEntity ? true : false;\r\n }\r\n}\r\n","import { sendAndUnwrap, sendMessageToParent } from '../internal/communication';\r\nimport { getUserJoinedTeamsSupportedAndroidClientVersion } from '../internal/constants';\r\nimport { GlobalVars } from '../internal/globalVars';\r\nimport { ensureInitialized, isCurrentSDKVersionAtLeast } from '../internal/internalAPIs';\r\nimport { errorNotSupportedOnPlatform, FrameContexts, HostClientType } from '../public/constants';\r\nimport { ErrorCode, SdkError } from '../public/interfaces';\r\nimport { runtime } from '../public/runtime';\r\nimport { TeamInstanceParameters, UserJoinedTeamsInformation } from './interfaces';\r\n\r\n/**\r\n * @hidden\r\n * Namespace to interact with the `teams` specific part of the SDK.\r\n * ------\r\n * Hide from docs\r\n *\r\n * @internal\r\n */\r\nexport namespace teams {\r\n export enum ChannelType {\r\n Regular = 0,\r\n Private = 1,\r\n Shared = 2,\r\n }\r\n\r\n export interface ChannelInfo {\r\n siteUrl: string;\r\n objectId: string;\r\n folderRelativeUrl: string;\r\n displayName: string;\r\n channelType: ChannelType;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Get a list of channels belong to a Team\r\n *\r\n * @param groupId - a team's objectId\r\n */\r\n export function getTeamChannels(groupId: string, callback: (error: SdkError, channels: ChannelInfo[]) => void): void {\r\n ensureInitialized(FrameContexts.content);\r\n\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n\r\n if (!groupId) {\r\n throw new Error('[teams.getTeamChannels] groupId cannot be null or empty');\r\n }\r\n\r\n if (!callback) {\r\n throw new Error('[teams.getTeamChannels] Callback cannot be null');\r\n }\r\n\r\n sendMessageToParent('teams.getTeamChannels', [groupId], callback);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Allow 1st party apps to call this function when they receive migrated errors to inform the Hub/Host to refresh the siteurl\r\n * when site admin renames siteurl.\r\n *\r\n * @param threadId - ID of the thread where the app entity will be created; if threadId is not\r\n * provided, the threadId from route params will be used.\r\n */\r\n export function refreshSiteUrl(threadId: string, callback: (error: SdkError) => void): void {\r\n ensureInitialized();\r\n\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n\r\n if (!threadId) {\r\n throw new Error('[teams.refreshSiteUrl] threadId cannot be null or empty');\r\n }\r\n\r\n if (!callback) {\r\n throw new Error('[teams.refreshSiteUrl] Callback cannot be null');\r\n }\r\n\r\n sendMessageToParent('teams.refreshSiteUrl', [threadId], callback);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Checks if teams capability is supported by the host\r\n *\r\n * @returns true if the teams capability is enabled in runtime.supports.teams and\r\n * false if it is disabled\r\n */\r\n export function isSupported(): boolean {\r\n return runtime.supports.teams ? true : false;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n *\r\n * @internal\r\n */\r\n export namespace fullTrust {\r\n export namespace joinedTeams {\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Allows an app to retrieve information of all user joined teams\r\n *\r\n * @param teamInstanceParameters - Optional flags that specify whether to scope call to favorite teams\r\n * @returns Promise that resolves with information about the user joined teams or rejects with an error when the operation has completed\r\n */\r\n export function getUserJoinedTeams(\r\n teamInstanceParameters?: TeamInstanceParameters,\r\n ): Promise {\r\n return new Promise(resolve => {\r\n ensureInitialized();\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n\r\n if (\r\n (GlobalVars.hostClientType === HostClientType.android ||\r\n GlobalVars.hostClientType === HostClientType.teamsRoomsAndroid ||\r\n GlobalVars.hostClientType === HostClientType.teamsPhones ||\r\n GlobalVars.hostClientType === HostClientType.teamsDisplays) &&\r\n !isCurrentSDKVersionAtLeast(getUserJoinedTeamsSupportedAndroidClientVersion)\r\n ) {\r\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\r\n throw new Error(JSON.stringify(oldPlatformError));\r\n }\r\n\r\n resolve(sendAndUnwrap('getUserJoinedTeams', teamInstanceParameters));\r\n });\r\n }\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Checks if teams.fullTrust.joinedTeams capability is supported by the host\r\n *\r\n * @returns true if the teams.fullTrust.joinedTeams capability is enabled in\r\n * runtime.supports.teams.fullTrust.joinedTeams and false if it is disabled\r\n */\r\n export function isSupported(): boolean {\r\n return runtime.supports.teams\r\n ? runtime.supports.teams.fullTrust\r\n ? runtime.supports.teams.fullTrust.joinedTeams\r\n ? true\r\n : false\r\n : false\r\n : false;\r\n }\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Allows an app to get the configuration setting value\r\n *\r\n * @param key - The key for the config setting\r\n * @returns Promise that resolves with the value for the provided configuration setting or rejects with an error when the operation has completed\r\n */\r\n export function getConfigSetting(key: string): Promise {\r\n return new Promise(resolve => {\r\n ensureInitialized();\r\n if (!isSupported()) {\r\n throw errorNotSupportedOnPlatform;\r\n }\r\n resolve(sendAndUnwrap('getConfigSetting', key));\r\n });\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Hide from docs\r\n * ------\r\n * Checks if teams.fullTrust capability is supported by the host\r\n * @returns true if the teams.fullTrust capability is enabled in runtime.supports.teams.fullTrust and\r\n * false if it is disabled\r\n */\r\n export function isSupported(): boolean {\r\n return runtime.supports.teams ? (runtime.supports.teams.fullTrust ? true : false) : false;\r\n }\r\n }\r\n}\r\n"],"names":["root","factory","exports","module","define","amd","self","v1","v4","uuid","byteToHex","i","toString","substr","buf","offset","bth","join","getRandomValues","crypto","bind","window","msCrypto","rnds8","Uint8Array","rnds","Array","r","Math","random","_nodeId","_clockseq","rng","bytesToUuid","_lastMSecs","_lastNSecs","options","b","node","clockseq","undefined","seedBytes","msecs","Date","getTime","nsecs","dt","Error","tl","tmh","n","ii","formatArgs","args","this","useColors","namespace","humanize","diff","c","color","splice","index","lastC","replace","match","save","namespaces","storage","setItem","removeItem","error","load","getItem","process","env","DEBUG","type","__nwjs","navigator","userAgent","toLowerCase","document","documentElement","style","WebkitAppearance","console","firebug","exception","table","parseInt","RegExp","$1","localStorage","localstorage","destroy","warned","warn","colors","log","debug","formatters","j","v","JSON","stringify","message","createDebug","prevTime","namespacesCache","enabledCache","enableOverride","enabled","curr","Number","ms","prev","coerce","unshift","format","formatter","val","call","apply","selectColor","extend","Object","defineProperty","enumerable","configurable","get","set","init","delimiter","newDebug","toNamespace","regexp","substring","length","default","stack","disable","names","map","skips","enable","split","len","push","name","test","keys","forEach","key","hash","charCodeAt","abs","s","m","h","d","parse","str","String","exec","parseFloat","fmtShort","msAbs","round","fmtLong","plural","isPlural","isFinite","long","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","definition","o","obj","prop","prototype","hasOwnProperty","Symbol","toStringTag","value","FileOpenPreference","ErrorCode","HostClientType","HostName","FrameContexts","TeamType","UserTeamRole","DialogDimension","version","defaultSDKVersionForCompatCheck","nonFullScreenVideoModeAPISupportVersion","locationAPIsRequiredVersion","mediaAPISupportVersion","validOrigins","userOriginUrlValidationRegExp","initializeCalled","initializeCompleted","additionalValidOrigins","isFramelessWindow","printCapabilityEnabled","ChannelType","TaskModuleDimension","authentication","errorNotSupportedOnPlatform","errorCode","NOT_SUPPORTED_ON_PLATFORM","validateHostAgainstPattern","pattern","host","suffix","validateOrigin","messageOrigin","protocol","messageOriginHost","some","GlobalVars","domainOrPattern","getGenericOnCompleteHandler","errorMessage","success","reason","compareSDKVersions","v2","NaN","v1parts","v2parts","isValidPart","x","every","generateGUID","deepFreeze","freeze","callCallbackWithErrorOrResultFromPromiseAndReturnPromise","funcHelper","callback","p","then","result","catch","e","callCallbackWithErrorOrBooleanFromPromiseAndReturnPromise","callCallbackWithSdkErrorFromPromiseAndReturnPromise","callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise","runWithTimeout","action","timeoutInMs","timeoutError","Promise","resolve","reject","timeoutHandle","setTimeout","clearTimeout","createTeamsAppLink","params","url","URL","encodeURIComponent","appId","pageId","webUrl","searchParams","append","channelId","subPageId","subEntityId","ensureInitialized","frameContext","expectedFrameContexts","found","isCurrentSDKVersionAtLeast","requiredVersion","clientSupportedSDKVersion","isNaN","isHostClientMobile","hostClientType","android","ios","throwExceptionIfMobileApiIsNotSupported","OLD_PLATFORM","processAdditionalValidOrigins","validMessageOrigins","combinedOriginUrls","concat","filter","_origin","dedupUrls","_originUrl","uploadCustomApp","manifestBlob","onComplete","sendMessageToParent","sendCustomMessage","actionName","sendCustomEvent","Communication","childWindow","sendMessageEventToChild","registerCustomHandler","customHandler","registerHandler","registerUserSettingsChangeHandler","settingTypes","handler","openFilePreview","filePreviewParameters","content","task","entityId","title","description","objectUrl","downloadUrl","webPreviewUrl","webEditUrl","baseUrl","editFile","viewerAction","fileOpenPreference","conversationId","authHandlers","authWindowMonitor","authParams","authenticateHelper","authenticateParameters","desktop","rigel","teamsRoomsWindows","teamsRoomsAndroid","teamsPhones","teamsDisplays","link","createElement","href","sendMessageToParentAsync","width","height","isExternal","response","fail","openAuthenticationWindow","getAuthTokenHelper","authTokenRequest","resources","claims","silent","getUserHelper","closeAuthenticationWindow","stopAuthenticationWindowMonitor","close","childOrigin","min","currentWindow","outerWidth","outerHeight","left","screenLeft","screenX","top","screenTop","screenY","open","startAuthenticationWindowMonitor","handleFailure","clearInterval","removeHandler","setInterval","closed","savedChildOrigin","handleSuccess","redirectIfWin32Outlook","callbackUrl","decodeURIComponent","location","search","indexOf","updateUrlParameter","assign","uri","initialize","registerAuthenticationHandlers","authenticate","isDifferentParamsInCall","authenticateParams","sidePanel","settings","remove","stage","meetingStage","successCallback","err","failureCallback","getAuthToken","getUser","userRequest","notifySuccess","waitForMessageQueue","parentWindow","notifyFailure","runtime","apiVersion","supports","appInstallDialog","calendar","chat","conversations","dialog","bot","update","logs","mail","meetingRoom","menus","monetization","notifications","pages","appButton","tabs","config","backStack","fullTrust","people","remoteCamera","sharing","teams","joinedTeams","teamsCore","video","teamsRuntimeConfig","appEntity","v1HostClientTypes","web","surfaceHub","versionConstants","capability","hostClientTypes","generateBackCompatRuntimeConfig","highestSupportedVersion","newSupports","versionNumber","capabilityReqs","includes","isLegacyTeams","applyRuntimeConfig","runtimeConfig","transformLegacyContextToAppContext","legacyContext","app","locale","sessionId","appSessionId","theme","iconPositionVertical","appIconPosition","osLocaleInfo","parentMessageId","userClickTime","userFileOpenPreference","hostName","clientType","ringId","appLaunchId","page","id","isFullScreen","isMultiWindow","sourceOrigin","user","userObjectId","displayName","userDisplayName","isCallingAllowed","isPSTNCallingAllowed","licenseType","userLicenseType","loginHint","userPrincipalName","tenant","tid","teamsSku","tenantSKU","channel","channelName","relativeUrl","channelRelativeUrl","membershipType","channelType","defaultOneNoteSectionId","ownerGroupId","hostTeamGroupId","ownerTenantId","hostTeamTenantId","chatId","meeting","meetingId","sharepoint","team","teamId","internalId","teamName","teamType","groupId","templateId","teamTemplateId","isArchived","isTeamArchived","userRole","userTeamRole","sharePointSite","teamSiteUrl","teamSiteDomain","teamSitePath","mySitePath","mySiteDomain","teamSiteId","storedMessages","handleDialogMessage","isSupported","getDialogInfoFromUrlDialogInfo","urlDialogInfo","size","Small","fallbackUrl","getDialogInfoFromBotUrlDialogInfo","botUrlDialogInfo","completionBotId","submitHandler","messageFromChildHandler","submit","appIds","isArray","sendMessageToParentFromDialog","sendMessageToDialog","registerOnMessageFromParent","listener","reverse","pop","resize","dimensions","DisplayMode","navBarMenuItemPressHandler","actionMenuItemPressHandler","viewConfigItemPressHandler","selected","handleViewConfigItemPress","handleNavBarMenuItemPress","handleActionMenuItemPress","MenuItem","MenuListType","setUpViews","viewConfig","setNavBarMenu","items","showActionMenu","print","enablePrintCapability","addEventListener","event","ctrlKey","metaKey","keyCode","cancelBubble","preventDefault","stopImmediatePropagation","registerOnLoadHandler","registerBeforeUnloadHandler","Messages","AppLoaded","Success","Failure","ExpectedFailure","FailedReason","ExpectedFailureReason","isInitialized","getFrameContext","initializeHelper","initializePromise","initializeCommunication","context","givenRuntimeConfig","SyntaxError","registerOnThemeChangeHandler","_initialize","hostWindow","_uninitialize","registerBackButtonHandler","registerFullScreenHandler","registerGetLogHandler","registerOnSaveHandler","registerOnRemoveHandler","uninitializeCommunication","getContext","sendAndUnwrap","notifyAppLoaded","appInitializationFailedRequest","notifyExpectedFailure","expectedFailureRequest","openLink","deepLink","setCurrentFrame","frameInfo","returnFocus","navigateForward","registerFocusEnterHandler","initializeWithFrameContext","getConfig","navigateCrossDomain","navigateToApp","shareDeepLink","deepLinkParameters","subPageLabel","subPageWebUrl","navigateToTab","tabInstance","getTabInstances","tabInstanceParameters","getMruTabInstances","saveHandler","handleSave","saveEvent","SaveEventImpl","handleRemove","setValidityState","validityState","setConfig","instanceConfig","registerChangeConfigHandler","notified","ensureNotNotified","removeEvent","RemoveEventImpl","backButtonPressHandler","navigateBack","handleBackButtonPress","enterFullscreen","exitFullscreen","onClick","onHoverEnter","onHoverLeave","topLevelLogger","getLogger","handlersLogger","handlers","initializeHandlers","HandlersPrivate","handleThemeChange","handleLoad","handleBeforeUnload","callHandlerLogger","callHandler","sendMessage","themeChangeHandler","loadHandler","beforeUnloadHandler","readyToUnload","communicationLogger","parentMessageQueue","childMessageQueue","nextMessageId","callbacks","promiseCallbacks","CommunicationPrivate","messageListener","evt","processMessage","parent","opener","extendedWindow","nativeInterface","onNativeMessage","handleParentMessage","parentOrigin","removeEventListener","sendAndHandleStatusAndReason","status","sendAndHandleStatusAndReasonWithDefaultError","defaultError","sendAndHandleSdkError","waitForResponse","sendMessageToParentHelper","requestId","argsOrCallback","Function","request","sendMessageToParentHelperLogger","logger","targetWindow","createMessageRequest","framelessPostMessage","targetOrigin","getTargetOrigin","postMessage","getTargetMessageQueue","data","messageSource","source","originalEvent","origin","shouldProcessMessage","updateRelationships","handleChildMessage","flushMessageQueue","handleParentMessageLogger","isPartialResponse","promiseCallback","func","called","sendMessageResponseToChild","NotificationTypes","ViewerActionTypes","UserSettingTypes","flushMessageQueueLogger","targetMessageQueue","target","shift","messageQueueMonitor","createMessageResponse","customEvent","createMessageEvent","timestamp","now","openConversation","openConversationRequest","sendPromise","onStartConversation","onCloseConversation","closeConversation","getChatMembers","createTeamsDeepLinkForChat","users","topic","teamsDeepLinkProtocol","teamsDeepLinkUsersUrlParameterName","createTeamsDeepLinkForCall","targets","withVideo","createTeamsDeepLinkForCalendar","attendees","startTime","endTime","subject","teamsDeepLinkAttendeesUrlParameterName","attendee","createTeamsDeepLinkForAppInstallDialog","openAppInstallDialog","openAPPInstallDialogParams","openChat","openChatRequest","members","openGroupChat","_instance","createFile","assembleAttachment","mimeType","file","sequence","sort","a","item","Blob","decodeAttachment","attachment","decoded","atob","chunk","byteNumbers","byteArray","blob","chunkSequence","throwExceptionIfMediaCallIsNotSupportedOnMobile","mediaInputs","isMediaCallForVideoAndImageInputs","isMediaCallForNonFullScreenVideoMode","isMediaCallForImageOutputFormats","isVideoControllerRegistered","mediaType","media","MediaType","Video","videoProps","videoController","validateSelectMediaInputs","maxMediaCount","Image","imageProps","imageOutputFormats","VideoAndImage","videoAndImageProps","isFullScreenMode","validateGetMediaInputs","FileFormat","ID","validateViewImagesInput","uriList","validateScanBarCodeInput","barCodeConfig","timeOutIntervalInSec","validatePeoplePickerInput","peoplePickerInputs","setSelected","openOrgWideSearchInChatOrChannel","singleSelect","stageView","appInitialization","transformAppContextToLegacyContext","registerAppButtonClickHandler","registerAppButtonHoverEnterHandler","registerAppButtonHoverLeaveHandler","registerChangeSettingsHandler","tabInfo","subEntityLabel","subEntityWebUrl","executeDeepLink","setFrameContext","appContext","File","captureImage","that","preview","getMedia","getMediaViaCallback","getMediaViaHandler","INVALID_ARGUMENTS","helper","mediaMimeType","mediaResult","mediaChunk","assemble","INTERNAL_ERROR","Media","MediaControllerEvent","getMediaType","notifyEventToApp","mediaEvent","controllerCallback","StartRecording","onRecordingStarted","notifyEventToHost","mediaControllerEvent","stop","StopRecording","VideoController","CameraStartMode","Source","ImageUriType","ImageOutputFormats","selectMedia","localAttachments","mediaArray","invalidInput","oldPlatformError","viewImages","scanBarCode","getLocationHelper","props","showLocationHelper","getLocation","showLocation","MeetingType","CallType","getIncomingClientAudioState","toggleIncomingClientAudio","getMeetingDetails","getAuthenticationTokenForAnonymousUser","getLiveStreamState","requestStartLiveStreaming","streamUrl","streamKey","requestStopLiveStreaming","registerLiveStreamChangedHandler","shareAppContentToStage","appContentUrl","getAppContentStageSharingCapabilities","stopSharingAppContentToStage","getAppContentStageSharingState","registerSpeakingStateChangeHandler","openPurchaseExperience","param1","param2","planInfo","openCalendarItem","openCalendarItemParams","itemId","trim","composeMeeting","composeMeetingParams","openMailItem","openMailItemParams","composeMail","composeMailParams","ComposeMailType","selectPeopleHelper","selectPeople","notifyVideoFrameProcessed","notifyError","VideoFrameFormat","EffectChangeType","registerForVideoFrame","frameCallback","videoFrame","notifySelectedVideoEffectChanged","effectChangeType","effectId","registerForVideoEffect","shareWebContentHelper","shareWebContentRequest","SharingAPIMessages","shareWebContent","validateNonEmptyContent","shareRequest","validateTypeConsistency","validateContentForSupportedTypes","stageViewParams","CallModalities","startCall","startCallParams","requestedModalities","getSettings","setSettings","instanceSettings","tasks","files","getUrlDialogInfoFromTaskInfo","taskInfo","getBotUrlDialogInfoFromTaskInfo","getDefaultSizeIfNotProvided","startTask","card","sdkResponse","ChildAppWindow","updateTask","extra","submitTask","CloudStorageProvider","CloudStorageProviderType","SpecialDocumentLibraryType","DocumentLibraryAccessType","FileDownloadStatus","getCloudStorageFolders","addCloudStorageFolder","deleteCloudStorageFolder","folderToDelete","getCloudStorageFolderContents","folder","providerCode","isSubdirectory","openCloudStorageFile","getExternalProviders","excludeAddedProviders","copyMoveFiles","selectedFiles","destinationFolder","destinationProviderCode","isMove","getFileDownloads","openDownloadFolder","fileObjectId","getPairedMeetingRoomInfo","sendCommandToPairedMeetingRoom","commandName","registerMeetingRoomCapabilitiesUpdateHandler","capabilities","registerMeetingRoomStatesUpdateHandler","states","showNotification","showNotificationParameters","ControlCommand","ErrorReason","SessionTerminatedReason","getCapableParticipants","requestControl","participant","sendControlCommand","terminateSession","registerOnCapableParticipantsChangeHandler","registerOnErrorHandler","registerOnDeviceStateChangeHandler","registerOnSessionStatusChangeHandler","selectAppEntity","threadId","categories","getTeamChannels","refreshSiteUrl","getUserJoinedTeams","teamInstanceParameters","getConfigSetting"],"sourceRoot":""}