Skip to content

Commit

Permalink
Merge branch 'master' into saching/adding_downloadFileAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
Sachin Gupta committed Oct 2, 2018
2 parents 6d0adb2 + 97e90ba commit 0e0d5b5
Show file tree
Hide file tree
Showing 4 changed files with 604 additions and 405 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -26,7 +26,7 @@ To install the stable version:

#### Production

You can access [these files on unpkg](https://unpkg.com/@microsoft/teams-js@1.3.4/dist/MicrosoftTeams.min.js), download them, or point your package manager to them.
You can access [these files on unpkg](https://unpkg.com/@microsoft/teams-js@1.3.5/dist/MicrosoftTeams.min.js), download them, or point your package manager to them.

## Usage

Expand All @@ -46,10 +46,10 @@ Reference the library inside of your `.html` page using:

```html
<!-- Microsoft Teams JavaScript API (via CDN) -->
<script src="https://unpkg.com/@microsoft/teams-js@1.3.4/dist/MicrosoftTeams.min.js" integrity="sha384-3zTjxw3msc6gKx3DseSU0lfRM129YrFjr2xgocfMIN/kBCdzJ88d+FSB1n3scUku" crossorigin="anonymous"></script>
<script src="https://unpkg.com/@microsoft/teams-js@1.3.5/dist/MicrosoftTeams.min.js" integrity="sha384-t1ID2NmMGB5huCWZdo2EV4RXQ9H/+VDaxxWeUfWuuVuYIc62+Xj7M5re4yqbpbDt" crossorigin="anonymous"></script>

<!-- Microsoft Teams JavaScript API (via npm) -->
<script src="node_modules/@microsoft/teams-js@1.3.4/dist/MicrosoftTeams.min.js"></script>
<script src="node_modules/@microsoft/teams-js@1.3.5/dist/MicrosoftTeams.min.js"></script>

<!-- Microsoft Teams JavaScript API (via local) -->
<script src="MicrosoftTeams.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name": "@microsoft/teams-js",
"author": "Microsoft Teams",
"version": "1.3.4",
"version": "1.3.5",
"description": "Microsoft Client SDK for building app for Microsoft teams",
"main": "./dist/MicrosoftTeams.min.js",
"typings": "./dist/MicrosoftTeams.d.ts",
Expand Down
63 changes: 58 additions & 5 deletions src/MicrosoftTeams.ts
Expand Up @@ -44,7 +44,7 @@ interface Window {
namespace microsoftTeams {
"use strict";

const version = "1.3.4";
const version = "1.3.5";

const validOrigins = [
"https://teams.microsoft.com",
Expand All @@ -56,7 +56,9 @@ namespace microsoftTeams {
"https://msft.spoppe.com",
"https://*.sharepoint.com",
"https://*.sharepoint-df.com",
"https://*.sharepointonline.com"
"https://*.sharepointonline.com",
"https://outlook.office.com",
"https://outlook-sdf.office.com"
];

// This will return a reg expression a given url
Expand Down Expand Up @@ -687,7 +689,8 @@ namespace microsoftTeams {
ensureInitialized(
frameContexts.content,
frameContexts.settings,
frameContexts.remove
frameContexts.remove,
frameContexts.task
);

let messageId = sendMessageRequest(parentWindow, "navigateCrossDomain", [
Expand Down Expand Up @@ -1147,7 +1150,8 @@ namespace microsoftTeams {
ensureInitialized(
frameContexts.content,
frameContexts.settings,
frameContexts.remove
frameContexts.remove,
frameContexts.task
);

if (hostClientType === HostClientType.desktop) {
Expand Down Expand Up @@ -2128,6 +2132,13 @@ namespace microsoftTeams {
* If client doesnt support the URL, the URL that needs to be opened in the browser.
*/
fallbackUrl?: string;

/**
* Specifies a bot ID to send the result of the user's interaction with the task module.
* If specified, the bot will receive a task/complete invoke event with a JSON object
* in the event payload.
*/
completionBotId?: string;
}

/**
Expand Down Expand Up @@ -2163,10 +2174,52 @@ namespace microsoftTeams {
): void {
ensureInitialized(frameContexts.content, frameContexts.task);

sendMessageRequest(parentWindow, "tasks.submitTask", [
// Send tasks.completeTask instead of tasks.submitTask message for backward compatibility with Mobile clients
sendMessageRequest(parentWindow, "tasks.completeTask", [
result,
Array.isArray(appIds) ? appIds : [appIds]
]);
}
}

/**
* @private
* Hide from docs
* --------
* Information about all members in a chat
*/
export interface ChatMembersInformation {
members: ThreadMember[];
}

/**
* @private
* Hide from docs
* --------
* Information about a chat member
*/
export interface ThreadMember {
/**
* The member's user principal name in the current tenant.
*/
upn: string;
}

/**
* @private
* Hide from docs
* ------
* Allows an app to retrieve information of all chat members
* Because a malicious party run your content in a browser, this value should
* be used only as a hint as to who the members are and never as proof of membership.
* @param callback The callback to invoke when the {@link ChatMembersInformation} object is retrieved.
*/
export function getChatMembers(
callback: (chatMembersInformation: ChatMembersInformation) => void
): void {
ensureInitialized();

const messageId = sendMessageRequest(parentWindow, "getChatMembers");
callbacks[messageId] = callback;
}
}

0 comments on commit 0e0d5b5

Please sign in to comment.