Skip to content

Commit

Permalink
Merge branch 'main' into vikramtha/appIDgetContext
Browse files Browse the repository at this point in the history
  • Loading branch information
TrevorJoelHarris authored Aug 13, 2024
2 parents 67df88a + 3120d90 commit ef4be07
Show file tree
Hide file tree
Showing 87 changed files with 5,300 additions and 6,710 deletions.
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,11 @@ appPackage/build
/coverage

# Dev tool directories
devTools/
devTools/

# Ignore Jest JUnit test results
apps/teamsjs-diagnostic-app/test-results/unit/unit-tests-report.xml

#Ignore package locks
apps/teamsjs-diagnostic-app/package-lock.json
apps/teamsjs-diagnostic-app/api/package-lock.json
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"cSpell.words": ["adal", "uninitialize"],
"cSpell.words": ["adal", "teamspace", "uninitialize"],
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.insertSpaces": true,
Expand Down
16 changes: 11 additions & 5 deletions RUNTIME.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ A minor version change is one by which the previous version can be transformed i

## I am making a change to the runtime object. Do I need to update the runtime version?

### *I have added a required property to IRuntime*
### _I have added a required property to IRuntime_

- Yes – new minor version is required number if this property can be generated by App SDK without loss of some previously supported functionality, new major version is required if some previously supported functionality is lost when this property is not provided by the host.

### *I have added an optional property or supported capability*
### _I have added an optional property or supported capability_

- No new version is required.

### *I have renamed or moved a supported capability*
### _I have renamed or moved a supported capability_

- Yes – new minor version is required.

### *I have removed a supported capability*
### _I have removed a supported capability_

- Yes – new major version is required.

### *I have merged or split capabilities*
### _I have merged or split capabilities_

- Yes – new major version is required.

Expand All @@ -41,3 +41,9 @@ A minor version change is one by which the previous version can be transformed i
5. Add an `IRuntimeUpgrade` to the `upgradeChain` that will transform the previous runtime version to the new one
6. Update "runtime versioning" tests in `packages/teams-js/test/public/runtime.spec.ts` to use new version number
7. Add a test for upgrading from the previous runtime version to the new one

## Do I need to update `mapTeamsVersionToSupportedCapabilities`?

The documentation on the `mapTeamsVersionToSupportedCapabilities` structure should generally help answer this question. That said,
if you are adding a new capability and it will be supported by any version of TeamsV1 or Teams Mobile, you will need to update the
`mapTeamsVersionToSupportedCapabilities` structure to indicate which version and which platforms support your new capability.
6 changes: 6 additions & 0 deletions apps/teams-test-app/e2e-test-data/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@
"title": "openLink stageView.open API Call with thread id - Success",
"type": "callResponse",
"boxSelector": "#box_executeDeepLink2",
"hostSdkVersion": {
"web": "<4.0.1"
},
"platformsExcluded": ["iOS"],
"inputValue": "https://teams.microsoft.com/l/stage/testAppId/0?context=%7B%22contentUrl%22%3A%22testContentUrl%22%2C%22websiteUrl%22%3A%22testWebsiteUrl%22%2C%22title%22%3A%22TestTitle%22%2C%22threadId%22%3A%22TestThreadId%22%7D",
"expectedAlertValue": "stageView.open called with {\"appId\":\"testAppId\",\"contentUrl\":\"testContentUrl\",\"threadId\":\"TestThreadId\",\"title\":\"TestTitle\",\"websiteUrl\":\"testWebsiteUrl\"}",
Expand All @@ -75,6 +78,9 @@
"title": "openLink stageView.open API Call without thread id - Success",
"type": "callResponse",
"boxSelector": "#box_executeDeepLink2",
"hostSdkVersion": {
"web": "<4.0.1"
},
"platformsExcluded": ["iOS"],
"inputValue": "https://teams.microsoft.com/l/stage/testAppId/0?context=%7B%22contentUrl%22%3A%22testContentUrl%22%2C%22websiteUrl%22%3A%22testWebsiteUrl%22%2C%22title%22%3A%22TestTitle%22%7D",
"expectedAlertValue": "stageView.open called with {\"appId\":\"testAppId\",\"contentUrl\":\"testContentUrl\",\"title\":\"TestTitle\",\"websiteUrl\":\"testWebsiteUrl\"}",
Expand Down
8 changes: 4 additions & 4 deletions apps/teams-test-app/e2e-test-data/authentication.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"title": "getUser API Call - Failure (Not full trust)",
"version": ">2.25.0",
"hostSdkVersion": {
"web": "<=3.1.0"
"web": "<=3.0.2"
},
"type": "callResponse",
"platformsExcluded": ["iOS"],
Expand All @@ -34,7 +34,7 @@
"title": "getUser API Call - Failure (Not full trust and not Microsoft owned)",
"version": ">2.25.0",
"hostSdkVersion": {
"web": ">3.1.0"
"web": ">3.0.2"
},
"type": "callResponse",
"platformsExcluded": ["iOS"],
Expand All @@ -46,7 +46,7 @@
"title": "getUser API Call - Success (Full trust app)",
"version": ">2.25.0",
"hostSdkVersion": {
"web": ">3.1.0"
"web": ">3.0.2"
},
"type": "callResponse",
"platformsExcluded": ["iOS"],
Expand All @@ -58,7 +58,7 @@
"title": "getUser API Call - Success (Full trust and Microsoft owned app)",
"version": ">2.25.0",
"hostSdkVersion": {
"web": ">3.1.0"
"web": ">3.0.2"
},
"type": "callResponse",
"platformsExcluded": ["iOS"],
Expand Down
3 changes: 3 additions & 0 deletions apps/teams-test-app/e2e-test-data/stageView.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"title": "openStageView API Call - Success",
"type": "callResponse",
"boxSelector": "#box_stageViewOpen",
"hostSdkVersion": {
"web": "<4.0.1"
},
"inputValue": {
"appId": "appId",
"contentUrl": "contentUrl",
Expand Down
17 changes: 16 additions & 1 deletion apps/teams-test-app/e2e-test-data/video.sharedFrame.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,26 @@
{
"title": "videoEx.sharedFrame.registerForVideoFrame - Success",
"type": "callResponse",
"version": ">2.12.0",
"version": "<=2.25.0",
"boxSelector": "#box_videoExSharedFrameRegisterForVideoFrame1",
"hostSdkVersion": {
"web": "<=4.0.0"
},
"modulesToDisable": ["videoMediaStream"],
"expectedTestAppValue": "Registration attempt has been initiated. If successful, this message will change when it is invoked on video frame received.",
"expectedAlertValue": "sharedFrame.registerForVideoFrame called with config: {\"format\":\"NV12\",\"requireCameraStream\":false,\"audioInferenceModel\":{}}"
},
{
"title": "videoEx.sharedFrame.registerForVideoFrame - Success",
"type": "callResponse",
"version": ">2.25.0",
"boxSelector": "#box_videoExSharedFrameRegisterForVideoFrame1",
"hostSdkVersion": {
"web": ">4.0.0"
},
"modulesToDisable": ["videoMediaStream"],
"expectedTestAppValue": "Registration attempt has been initiated. If successful, this message will change when it is invoked on video frame received.",
"expectedAlertValue": "sharedFrame.registerForVideoFrame called with config: {\"format\":\"NV12\",\"requireCameraStream\":false,\"audioInferenceModel\":{},\"requiredCapabilities\":[]}"
}
]
}
4 changes: 2 additions & 2 deletions apps/teams-test-app/index_cdn.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<script
src="https://res.cdn.office.net/teams-js/2.25.0/js/MicrosoftTeams.min.js"
integrity="sha384-6royw0i5cEmf/8pzbTX9dVy1pjjJA8PQOaQbGvoL/m39OdjrlcWluhQZxqy5KbJA"
src="https://res.cdn.office.net/teams-js/2.26.0/js/MicrosoftTeams.min.js"
integrity="sha384-gqPg5qCjdUgTGRZ/stLskrnJllL5h5+f4kTqvxVqtl2FdT7PVRa9Q7zq4gFlZ7bO"
crossorigin="anonymous"
></script>
<div id="root"></div>
Expand Down
2 changes: 1 addition & 1 deletion apps/teams-test-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"author": "Microsoft Teams",
"description": "Teams Test App utilizing Teams JavaScript client SDK to test Hosts",
"version": "2.25.0",
"version": "2.26.0",
"scripts": {
"build": "pnpm build:bundle",
"build:bundle": "pnpm lint && webpack",
Expand Down
31 changes: 31 additions & 0 deletions apps/teams-test-app/src/components/StageViewSelfAPIs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { /*SdkError,*/ stageView } from '@microsoft/teams-js';
import React, { ReactElement } from 'react';

import { ApiWithoutInput /*, ApiWithTextInput*/ } from './utils';
import { ModuleWrapper } from './utils/ModuleWrapper';

const CheckStageViewSelfCapability = (): React.ReactElement =>
ApiWithoutInput({
name: 'checkStageViewSelfCapability',
title: 'Check StageView Self Capability',
onClick: async () => `StageView Self ${stageView.self.isSupported() ? 'is' : 'is not'} supported`,
});

const CloseStageView = (): ReactElement =>
ApiWithoutInput({
name: 'stageViewSelfClose',
title: 'StageView Self Close',
onClick: async () => {
await stageView.self.close();
return 'closed';
},
});

const StageViewSelfAPIs = (): ReactElement => (
<ModuleWrapper title="StageViewSelf">
<CloseStageView />
<CheckStageViewSelfCapability />
</ModuleWrapper>
);

export default StageViewSelfAPIs;
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ const MediaStreamRegisterForVideoFrame = (): React.ReactElement =>
onClick: async (setResult) => {
try {
const audioInferenceModel = new ArrayBuffer(8);
const requiredCapabilities = [];
const view = new Uint8Array(audioInferenceModel);
for (let i = 0; i < view.length; i++) {
view[i] = i;
Expand All @@ -121,6 +122,7 @@ const MediaStreamRegisterForVideoFrame = (): React.ReactElement =>
format: videoEffects.VideoFrameFormat.NV12,
requireCameraStream: false,
audioInferenceModel,
requiredCapabilities,
},
});
} catch (error) {
Expand Down Expand Up @@ -169,6 +171,7 @@ const SharedFrameRegisterForVideoFrame = (): React.ReactElement =>
onClick: async (setResult) => {
try {
const audioInferenceModel = new ArrayBuffer(8);
const requiredCapabilities = [];
const view = new Uint8Array(audioInferenceModel);
for (let i = 0; i < view.length; i++) {
view[i] = i;
Expand All @@ -184,6 +187,7 @@ const SharedFrameRegisterForVideoFrame = (): React.ReactElement =>
format: videoEffects.VideoFrameFormat.NV12,
requireCameraStream: false,
audioInferenceModel,
requiredCapabilities,
},
});
} catch (error) {
Expand Down
2 changes: 2 additions & 0 deletions apps/teams-test-app/src/pages/TestApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import SearchAPIs from '../components/SearchAPIs';
import SecondaryBrowserAPIs from '../components/SecondaryBrowserAPIs';
import SharingAPIs from '../components/SharingAPIs';
import StageViewAPIs from '../components/StageViewAPIs';
import StageViewSelfAPIs from '../components/StageViewSelfAPIs';
import TeamsCoreAPIs from '../components/TeamsCoreAPIs';
import ThirdPartyCloudStorageAPIs from '../components/ThirdPartyCloudStorageAPIs';
import CookieAccessComponent from '../components/ThirdPatryCookies';
Expand Down Expand Up @@ -123,6 +124,7 @@ export const TestApp: React.FC = () => {
<SharingAPIs />
<WebStorageAPIs />
<StageViewAPIs />
<StageViewSelfAPIs />
<TeamsCoreAPIs />
<TeamsAPIs />
<ThirdPartyCloudStorageAPIs />
Expand Down
Loading

0 comments on commit ef4be07

Please sign in to comment.