From 044498e81385bd5f86a4090dbdb7cf176f21817b Mon Sep 17 00:00:00 2001 From: Shreyas Date: Tue, 14 May 2024 17:17:45 -0700 Subject: [PATCH 01/12] Initial --- apps/teams-test-app/src/App.tsx | 4 ++ .../teams-js/src/internal/communication.ts | 48 +++++++++++++++---- packages/teams-js/src/internal/telemetry.ts | 1 + packages/teams-js/src/public/app.ts | 10 ++++ 4 files changed, 55 insertions(+), 8 deletions(-) diff --git a/apps/teams-test-app/src/App.tsx b/apps/teams-test-app/src/App.tsx index e9b1419fb1..d65c280a0f 100644 --- a/apps/teams-test-app/src/App.tsx +++ b/apps/teams-test-app/src/App.tsx @@ -73,6 +73,10 @@ if (!urlParams.has('customInit') || !urlParams.get('customInit')) { if (isTestBackCompat()) { initialize(); } else { + app.getHostName().then((hostName) => { + console.log('%cHost Name: ', 'background-color: blue', hostName); + }); + app.initialize(); } } diff --git a/packages/teams-js/src/internal/communication.ts b/packages/teams-js/src/internal/communication.ts index a4e0d79a9c..95b44df8e9 100644 --- a/packages/teams-js/src/internal/communication.ts +++ b/packages/teams-js/src/internal/communication.ts @@ -70,13 +70,9 @@ interface InitializeResponse { } /** - * @internal - * Limited to Microsoft-internal use + * set windows for communication */ -export function initializeCommunication( - validMessageOrigins: string[] | undefined, - apiVersionTag: string, -): Promise { +function setWindows(validMessageOrigins: string[] | undefined): void { // Listen for messages post to our window CommunicationPrivate.messageListener = async (evt: DOMMessageEvent): Promise => await processMessage(evt); @@ -102,10 +98,20 @@ export function initializeCommunication( extendedWindow.onNativeMessage = handleParentMessage; } else { // at this point we weren't able to find a parent to talk to, no way initialization will succeed - return Promise.reject(new Error('Initialization Failed. No Parent window found.')); + throw new Error('Initialization Failed. No Parent window found.'); } } +} +/** + * @internal + * Limited to Microsoft-internal use + */ +export function initializeCommunication( + validMessageOrigins: string[] | undefined, + apiVersionTag: string, +): Promise { + setWindows(validMessageOrigins); try { // Send the initialized message to any origin, because at this point we most likely don't know the origin // of the parent window, and this message contains no data that could pose a security risk. @@ -365,6 +371,33 @@ export function sendNestedAuthRequestToTopWindow(message: string): NestedAppAuth return sendRequestToTargetWindowHelper(targetWindow, request) as NestedAppAuthRequest; } +/** + * @internal + * Limited to Microsoft-internal use + */ +export function sendAndGetHostName(apiVersionTag: string): Promise { + const request = [ + { + id: CommunicationPrivate.nextMessageId++, + timestamp: Date.now(), + func: 'getHostName', + }, + ]; + try { + setWindows(undefined); + Communication.parentOrigin = '*'; + return sendMessageToParentAsync(apiVersionTag, 'getHostName', request); + } catch (error) { + if (error.message === 'Initialization Failed. No Parent window found.') { + return Promise.resolve('App is not running inside iframe.'); + } else { + return Promise.reject(error); + } + } finally { + Communication.parentOrigin = null; + } +} + const sendRequestToTargetWindowHelperLogger = communicationLogger.extend('sendRequestToTargetWindowHelper'); /** @@ -385,7 +418,6 @@ function sendRequestToTargetWindowHelper( } } else { const targetOrigin = getTargetOrigin(targetWindow); - // If the target window isn't closed and we already know its origin, send the message right away; otherwise, // queue the message and send it after the origin is established if (targetWindow && targetOrigin) { diff --git a/packages/teams-js/src/internal/telemetry.ts b/packages/teams-js/src/internal/telemetry.ts index d7049ec8d5..5341ec8b25 100644 --- a/packages/teams-js/src/internal/telemetry.ts +++ b/packages/teams-js/src/internal/telemetry.ts @@ -52,6 +52,7 @@ export const enum ApiVersionNumber { export const enum ApiName { App_GetContext = 'app.getContext', + App_GetHostName = 'app.getHostName', App_Initialize = 'app.initialize', App_NotifyAppLoaded = 'app.notifyAppLoaded', App_NotifyExpectedFailure = 'app.notifyExpectedFailure', diff --git a/packages/teams-js/src/public/app.ts b/packages/teams-js/src/public/app.ts index 1a2bb1a3ee..8e4e0f45eb 100644 --- a/packages/teams-js/src/public/app.ts +++ b/packages/teams-js/src/public/app.ts @@ -5,6 +5,7 @@ import { Communication, initializeCommunication, + sendAndGetHostName, sendAndHandleStatusAndReason, sendAndUnwrap, sendMessageToParent, @@ -725,6 +726,15 @@ export namespace app { return GlobalVars.initializeCompleted; } + /** + * Gets the host name where the app is running. If the app is not running in a hosted environment, + * it will return `App is not running inside iframe.` message or error message. + * @returns A promise that resolves to the host name. + */ + export async function getHostName(): Promise { + return await sendAndGetHostName(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_GetHostName)); + } + /** * Gets the Frame Context that the App is running in. See {@link FrameContexts} for the list of possible values. * @returns the Frame Context. From 4ad8d2eff52996fca4908c9937a4b8f2d46e7d6d Mon Sep 17 00:00:00 2001 From: Shreyas Date: Wed, 15 May 2024 12:54:04 -0700 Subject: [PATCH 02/12] Update . --- packages/teams-js/src/public/app.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/teams-js/src/public/app.ts b/packages/teams-js/src/public/app.ts index 8e4e0f45eb..4abcb6231a 100644 --- a/packages/teams-js/src/public/app.ts +++ b/packages/teams-js/src/public/app.ts @@ -9,6 +9,7 @@ import { sendAndHandleStatusAndReason, sendAndUnwrap, sendMessageToParent, + sendMessageToParentAsync, uninitializeCommunication, } from '../internal/communication'; import { defaultSDKVersionForCompatCheck } from '../internal/constants'; @@ -732,7 +733,14 @@ export namespace app { * @returns A promise that resolves to the host name. */ export async function getHostName(): Promise { - return await sendAndGetHostName(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_GetHostName)); + if (GlobalVars.initializeCompleted) { + return await sendMessageToParentAsync( + getApiVersionTag(appTelemetryVersionNumber, ApiName.App_GetHostName), + 'getHostName', + ); + } else { + return await sendAndGetHostName(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_GetHostName)); + } } /** From 0f49f5d3c81d866863559c0d6e52dd4ead0bf2c7 Mon Sep 17 00:00:00 2001 From: Shreyas Date: Thu, 16 May 2024 11:13:54 -0700 Subject: [PATCH 03/12] Updatte --- apps/teams-test-app/src/App.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/teams-test-app/src/App.tsx b/apps/teams-test-app/src/App.tsx index d65c280a0f..aea89d4767 100644 --- a/apps/teams-test-app/src/App.tsx +++ b/apps/teams-test-app/src/App.tsx @@ -76,6 +76,7 @@ if (!urlParams.has('customInit') || !urlParams.get('customInit')) { app.getHostName().then((hostName) => { console.log('%cHost Name: ', 'background-color: blue', hostName); }); + console.log('App Initialization'); app.initialize(); } From 46410915ce5bfd34ea78bffb710f3a9883b4bb9d Mon Sep 17 00:00:00 2001 From: Shreyas Date: Thu, 16 May 2024 14:00:22 -0700 Subject: [PATCH 04/12] Update tests --- .../teams-js/test/internal/communication.spec.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/teams-js/test/internal/communication.spec.ts b/packages/teams-js/test/internal/communication.spec.ts index 4d15db4b7b..11e1873920 100644 --- a/packages/teams-js/test/internal/communication.spec.ts +++ b/packages/teams-js/test/internal/communication.spec.ts @@ -29,10 +29,11 @@ describe('Testing communication', () => { GlobalVars.isFramelessWindow = false; }); - it('should throw if there is no parent window and no native interface on the current window', async () => { + it('should throw if there is no parent window and no native interface on the current window', () => { app._initialize(undefined); - const initPromise = communication.initializeCommunication(undefined, testApiVersion); - await expect(initPromise).rejects.toThrowError('Initialization Failed. No Parent window found.'); + expect(() => communication.initializeCommunication(undefined, testApiVersion)).toThrowError( + 'Initialization Failed. No Parent window found.', + ); }); it('should receive valid initialize response from parent when there is no parent window but the window has a native interface', async () => { @@ -206,8 +207,9 @@ describe('Testing communication', () => { // In this case, because Communication.currentWindow is being initialized to undefined we fall back to the actual // window object created by jest, which does not have nativeInterface defined on it app._initialize(undefined); - const initPromise = communication.initializeCommunication(undefined, testApiVersion); - await expect(initPromise).rejects.toThrowError('Initialization Failed. No Parent window found.'); + expect(() => communication.initializeCommunication(undefined, testApiVersion)).toThrowError( + 'Initialization Failed. No Parent window found.', + ); }); it('should receive valid initialize response from parent when currentWindow has a parent with postMessage defined', async () => { From e01fbedb60b87c682325ff7320590dff7c847d1d Mon Sep 17 00:00:00 2001 From: Trevor Harris Date: Fri, 17 May 2024 14:12:23 -0700 Subject: [PATCH 05/12] Create CODE_OF_CONDUCT.md (#2331) --- CODE_OF_CONDUCT.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000..686e5e7a09 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,10 @@ +# Microsoft Open Source Code of Conduct + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). + +Resources: + +- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) +- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) +- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns +- Employees can reach out at [aka.ms/opensource/moderation-support](https://aka.ms/opensource/moderation-support) From bf11a799240bc167b7df3b3262a5db0abb499522 Mon Sep 17 00:00:00 2001 From: Trevor Harris Date: Fri, 17 May 2024 15:03:49 -0700 Subject: [PATCH 06/12] Create SECURITY.md (#2332) --- SECURITY.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000000..28b2488acd --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,41 @@ + + +## Security + +Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin). + +If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below. + +## Reporting Security Issues + +**Please do not report security vulnerabilities through public GitHub issues.** + +Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report). + +If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp). + +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). + +Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: + +- Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) +- Full paths of source file(s) related to the manifestation of the issue +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- Step-by-step instructions to reproduce the issue +- Proof-of-concept or exploit code (if possible) +- Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs. + +## Preferred Languages + +We prefer all communications to be in English. + +## Policy + +Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd). + + From b429900c6fbdc2b1d6a1a8ec6cdd4945f8fa02dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?AE=20=28=20=CD=A1=E0=B2=A0=20=CA=96=CC=AF=20=CD=A1?= =?UTF-8?q?=E0=B2=A0=29?= <36546967+AE-MS@users.noreply.github.com> Date: Mon, 20 May 2024 19:28:25 -0700 Subject: [PATCH 07/12] Update all link navigation functions to clarify appropriate usage (#2333) * First pass at updated docs * More doc updates * More doc updates * More doc updates * More doc updates * changefile * Incorporate docs feedback --- ...-02195148-1a67-4aaa-9eb2-a6bf157cb57e.json | 7 +++ packages/teams-js/src/public/app.ts | 31 ++++++++++-- packages/teams-js/src/public/pages.ts | 47 +++++++++++-------- packages/teams-js/src/public/publicAPIs.ts | 13 +++-- 4 files changed, 71 insertions(+), 27 deletions(-) create mode 100644 change/@microsoft-teams-js-02195148-1a67-4aaa-9eb2-a6bf157cb57e.json diff --git a/change/@microsoft-teams-js-02195148-1a67-4aaa-9eb2-a6bf157cb57e.json b/change/@microsoft-teams-js-02195148-1a67-4aaa-9eb2-a6bf157cb57e.json new file mode 100644 index 0000000000..388c3a8935 --- /dev/null +++ b/change/@microsoft-teams-js-02195148-1a67-4aaa-9eb2-a6bf157cb57e.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "Updated documentation for all link navigation functions to be clearer about appropriate usage", + "packageName": "@microsoft/teams-js", + "email": "36546967+AE-MS@users.noreply.github.com", + "dependentChangeType": "none" +} diff --git a/packages/teams-js/src/public/app.ts b/packages/teams-js/src/public/app.ts index ba3a6495ae..acd2b60bae 100644 --- a/packages/teams-js/src/public/app.ts +++ b/packages/teams-js/src/public/app.ts @@ -905,10 +905,35 @@ export namespace app { } /** - * open link API. + * This function opens deep links to other modules in the host such as chats or channels or + * general-purpose links (to external websites). It should not be used for navigating to your + * own or other apps. * - * @param deepLink - deep link. - * @returns Promise that will be fulfilled when the operation has completed + * @remarks + * If you need to navigate to your own or other apps, use: + * + * - {@link pages.currentApp.navigateToDefaultPage} for navigating to the default page of your own app + * - {@link pages.currentApp.navigateTo} for navigating to a section of your own app + * - {@link pages.navigateToApp} for navigating to other apps besides your own + * + * Many areas of functionality previously provided by deep links are now handled by strongly-typed functions in capabilities. + * If your app is using a deep link to trigger these specific components, use the strongly-typed alternatives. + * For example (this list is not exhaustive): + * - To open an app installation dialog, use the {@link appInstallDialog} capability + * - To start a call, use the {@link call} capability + * - To open a chat, use the {@link chat} capability + * - To open a dialog, use the {@link dialog} capability + * - To create a new meeting, use the {@link calendar.composeMeeting} function + * - To open a Stage View, use the {@link stageView} capability + * + * In each of these capabilities, you can use the `isSupported()` function to determine if the host supports that capability. + * When using a deep link to trigger these components, there's no way to determine whether the host supports it. + * + * For more information on crafting deep links to the host, see [Configure deep links](https://learn.microsoft.com/microsoftteams/platform/concepts/build-and-test/deep-links) + * + * @param deepLink The host deep link or external web URL to which to navigate + * @returns `Promise` that will be fulfilled when the navigation has initiated. A successful `Promise` resolution + * does not necessarily indicate whether the target loaded successfully. */ export function openLink(deepLink: string): Promise { return openLinkHelper(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_OpenLink), deepLink); diff --git a/packages/teams-js/src/public/pages.ts b/packages/teams-js/src/public/pages.ts index 410fd763d9..ab4d09ae32 100644 --- a/packages/teams-js/src/public/pages.ts +++ b/packages/teams-js/src/public/pages.ts @@ -292,13 +292,12 @@ export namespace pages { } /** - * Navigate to the given application ID and page ID, with optional parameters for a WebURL (if the application - * cannot be navigated to, such as if it is not installed), Channel ID (for applications installed as a channel tab), - * and sub-page ID (for navigating to specific content within the page). This is equivalent to navigating to - * a deep link with the above data, but does not require the application to build a URL or worry about different - * deep link formats for different hosts. - * @param params - Parameters for the navigation - * @returns a promise that will resolve if the navigation was successful + * Used to navigate to apps other than your own. + * + * If you are looking to navigate within your own app, use {@link pages.currentApp.navigateToDefaultPage} or {@link pages.currentApp.navigateTo} + * + * @param params Parameters for the navigation + * @returns a `Promise` that will resolve if the navigation was successful or reject if it was not */ export function navigateToApp(params: NavigateToAppParams): Promise { return new Promise((resolve) => { @@ -372,28 +371,28 @@ export namespace pages { */ export interface NavigateToAppParams { /** - * ID of the application to navigate to + * ID of the app to navigate to */ appId: string; /** - * Developer-defined ID of the Page to navigate to within the application (Formerly EntityID) + * Developer-defined ID of the page to navigate to within the app (formerly called `entityId`) */ pageId: string; /** - * Optional URL to open if the navigation cannot be completed within the host + * Fallback URL to open if the navigation cannot be completed within the host (e.g. if the target app is not installed) */ webUrl?: string; /** - * Optional developer-defined ID describing the content to navigate to within the Page. This will be passed - * back to the application via the Context object. + * Developer-defined ID describing the content to navigate to within the page. This ID is passed to the application + * via the {@link app.PageInfo.subPageId} property on the {@link app.Context} object (retrieved by calling {@link app.getContext}) */ subPageId?: string; /** - * Optional ID of the Teams Channel where the application should be opened + * For apps installed as a channel tab, this ID can be supplied to indicate in which Teams channel the app should be opened */ channelId?: string; } @@ -1007,11 +1006,14 @@ export namespace pages { } /** - * Provides functions for navigating without needing to specify your application ID. + * Provides functions for navigating within your own app + * + * @remarks + * If you are looking to navigate to a different app, use {@link pages.navigateToApp}. */ export namespace currentApp { /** - * Parameters for the NavigateWithinApp + * Parameters provided to the {@link pages.currentApp.navigateTo} function */ export interface NavigateWithinAppParams { /** @@ -1028,10 +1030,13 @@ export namespace pages { } /** - * Navigate within the currently running application with page ID, and sub-page ID (for navigating to - * specific content within the page). - * @param params - Parameters for the navigation - * @returns a promise that will resolve if the navigation was successful + * Navigate within the currently running app + * + * @remarks + * If you are looking to navigate to a different app, use {@link pages.navigateToApp}. + * + * @param params Parameters for the navigation + * @returns `Promise` that will resolve if the navigation was successful and reject if not */ export function navigateTo(params: NavigateWithinAppParams): Promise { return new Promise((resolve) => { @@ -1058,8 +1063,10 @@ export namespace pages { } /** - * Navigate to the currently running application's first static page defined in the application + * Navigate to the currently running app's first static page defined in the application * manifest. + * + * @returns `Promise` that will resolve if the navigation was successful and reject if not */ export function navigateToDefaultPage(): Promise { return new Promise((resolve) => { diff --git a/packages/teams-js/src/public/publicAPIs.ts b/packages/teams-js/src/public/publicAPIs.ts index fa3ea50810..4578b527fe 100644 --- a/packages/teams-js/src/public/publicAPIs.ts +++ b/packages/teams-js/src/public/publicAPIs.ts @@ -24,7 +24,7 @@ import { teamsCore } from './teamsAPIs'; */ const publicAPIsTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_1; -/** Execute deep link on complete function type */ +/** Type of callback used to indicate when {@link executeDeepLink} completes */ export type executeDeepLinkOnCompleteFunctionType = (status: boolean, reason?: string) => void; /** Callback function type */ export type callbackFunctionType = () => void; @@ -339,11 +339,16 @@ export function shareDeepLink(deepLinkParameters: DeepLinkParameters): void { /** * @deprecated - * As of 2.0.0, please use {@link app.openLink app.openLink(deepLink: string): Promise\} instead. + * This function was previously used for opening various types of links. As of TeamsJS v2.0.0, it has been replaced with multiple different + * functions depending on the type of link: * - * Execute deep link API. + * - Use {@link pages.currentApp.navigateToDefaultPage} to navigate to the default page of your own app + * - Use {@link pages.currentApp.navigateTo} to navigate to a section of your own app + * - Use {@link pages.navigateToApp} to navigate to other apps besides your own + * - Use {@link app.openLink} for opening deep links to other parts of the host (e.g., to chats or channels) or + * general-purpose links (e.g., to external websites). * - * @param deepLink - deep link. + * @param deepLink deep link. */ export function executeDeepLink(deepLink: string, onComplete?: executeDeepLinkOnCompleteFunctionType): void { ensureInitialized( From de0972dc9220fdb36b9e40df840e7dcacbc9dba9 Mon Sep 17 00:00:00 2001 From: KangxuanYe <107154810+KangxuanYe@users.noreply.github.com> Date: Tue, 21 May 2024 11:31:58 -0700 Subject: [PATCH 08/12] Publish xctest result for screenshots and diagnostic logs (#2306) * Publish xctest result for screenshots * update * update * update * update * update * update * update * update * update * update * add attempts * update * update yml file to use original junit file path * update copy file process * generate test result in original places * copy testResults * fix yaml file indent error * add generating xchtmlreport process for published artifacts * remove useless task * update: --- tools/yaml-templates/ios-test.yml | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/tools/yaml-templates/ios-test.yml b/tools/yaml-templates/ios-test.yml index 132b71f768..0293d838b0 100644 --- a/tools/yaml-templates/ios-test.yml +++ b/tools/yaml-templates/ios-test.yml @@ -18,7 +18,8 @@ steps: targetType: inline script: | brew install xctesthtmlreport - workingDirectory: '$(System.DefaultWorkingDirectory)' + workingDirectory: '$(Agent.BuildDirectory)/iOSHost' + condition: always() - task: NodeTool@0 inputs: @@ -90,19 +91,40 @@ steps: - task: Bash@3 displayName: 'Generate E2E test report' - condition: succeededOrFailed() inputs: targetType: inline script: | xchtmlreport -r TestResults -j; if [[ $? == 0 ]]; then echo "Test report has been generated successfully."; exit 0; else echo "Test report generating process failed for some reasons."; exit 1; fi; workingDirectory: '$(Agent.BuildDirectory)/iOSHost' + condition: always() - task: PublishTestResults@2 displayName: 'Publish Test Results' inputs: testResultsFiles: '**/*.junit' failTaskOnFailedTests: false - testRunTitle: 'E2E Tests - iOS' + testRunTitle: 'E2E Tests - $(agent.JobName)' searchFolder: '$(Agent.BuildDirectory)/iOSHost' mergeTestResults: true + condition: succeededOrFailed() + + - bash: | + output="$(agent.buildDirectory)/Logs/$(agent.JobName)" + rm -rf "${output}" > /dev/null + + mkdir -p "${output}" + + cp -r $(Agent.BuildDirectory)/iOSHost/TestResults "${output}/output.xcresult" + xchtmlreport -r ${output}/output.xcresult -j + + + echo "ls -lR ${output}" + ls -lR "${output}" + displayName: Preparations for publishing results + condition: always() + + - task: 1ES.PublishPipelineArtifact@1 + inputs: + path: '$(agent.buildDirectory)/Logs' + artifact: iOSDebugLogs - ${{ parameters.testPlan }} - Attempt $(System.JobAttempt) condition: always() From 739ddf36968f844d96c617b22b9b5e80ef17959c Mon Sep 17 00:00:00 2001 From: Shreyas <98348000+shrshindeMSFT@users.noreply.github.com> Date: Tue, 21 May 2024 13:45:59 -0700 Subject: [PATCH 09/12] Added url search parameters for insecure e2e testing (#2336) * Add url search parameters for insecure e2e testing * Update * Update --- apps/teams-test-app/src/App.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/teams-test-app/src/App.tsx b/apps/teams-test-app/src/App.tsx index aea89d4767..7fe9665b8d 100644 --- a/apps/teams-test-app/src/App.tsx +++ b/apps/teams-test-app/src/App.tsx @@ -68,17 +68,22 @@ import WebStorageAPIs from './components/WebStorageAPIs'; const urlParams = new URLSearchParams(window.location.search); +// The search url parameter 'origins' is used to get the valid message origins which will be passed to +// the initialize function and based on the hosts it will allow the origins or not. +// The valid message origins are separated by comma. For example: https://relecloud.com/?origins=https://relecoud.com,https://*.relecloud.com +const getOriginsParam = urlParams.has('origins') && urlParams.get('origins') ? urlParams.get('origins') : ''; +const validMessageOrigins: string[] | undefined = getOriginsParam ? getOriginsParam.split(',') : undefined; + // This is added for custom initialization when app can be initialized based upon a trigger/click. if (!urlParams.has('customInit') || !urlParams.get('customInit')) { if (isTestBackCompat()) { - initialize(); + initialize(undefined, validMessageOrigins); } else { app.getHostName().then((hostName) => { console.log('%cHost Name: ', 'background-color: blue', hostName); }); console.log('App Initialization'); - - app.initialize(); + app.initialize(validMessageOrigins); } } From 996f77600c47f3366708f15e7566be68f73170cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?AE=20=28=20=CD=A1=E0=B2=A0=20=CA=96=CC=AF=20=CD=A1?= =?UTF-8?q?=E0=B2=A0=29?= <36546967+AE-MS@users.noreply.github.com> Date: Wed, 22 May 2024 08:56:49 -0700 Subject: [PATCH 10/12] Update 2.0.0 version references in docs to be TeamsJS v2.0.0 per docs team recommendation (#2335) * Update 2.0.0 version references in docs to be TeamsJS v2.0.0 * Changefile --- ...-5e7e369c-e6b5-445f-871f-841e22dc4197.json | 7 ++ .../teams-js/src/public/appInitialization.ts | 20 +-- .../teams-js/src/public/authentication.ts | 20 +-- packages/teams-js/src/public/constants.ts | 4 +- packages/teams-js/src/public/interfaces.ts | 118 +++++++++--------- packages/teams-js/src/public/monetization.ts | 2 +- packages/teams-js/src/public/navigation.ts | 8 +- packages/teams-js/src/public/pages.ts | 2 +- packages/teams-js/src/public/people.ts | 2 +- packages/teams-js/src/public/publicAPIs.ts | 38 +++--- packages/teams-js/src/public/settings.ts | 20 +-- packages/teams-js/src/public/sharing.ts | 2 +- packages/teams-js/src/public/tasks.ts | 4 +- 13 files changed, 127 insertions(+), 120 deletions(-) create mode 100644 change/@microsoft-teams-js-5e7e369c-e6b5-445f-871f-841e22dc4197.json diff --git a/change/@microsoft-teams-js-5e7e369c-e6b5-445f-871f-841e22dc4197.json b/change/@microsoft-teams-js-5e7e369c-e6b5-445f-871f-841e22dc4197.json new file mode 100644 index 0000000000..f634fc1f1b --- /dev/null +++ b/change/@microsoft-teams-js-5e7e369c-e6b5-445f-871f-841e22dc4197.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "Updated 2.0.0 version references in docs to be TeamsJS v2.0.0", + "packageName": "@microsoft/teams-js", + "email": "36546967+AE-MS@users.noreply.github.com", + "dependentChangeType": "none" +} diff --git a/packages/teams-js/src/public/appInitialization.ts b/packages/teams-js/src/public/appInitialization.ts index e89c5b627f..78ab71d13c 100644 --- a/packages/teams-js/src/public/appInitialization.ts +++ b/packages/teams-js/src/public/appInitialization.ts @@ -9,7 +9,7 @@ import { /** * @deprecated - * As of 2.0.0, please use {@link app} namespace instead. + * As of TeamsJS v2.0.0, please use {@link app} namespace instead. * * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY */ @@ -18,36 +18,36 @@ const appInitializationTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumb export namespace appInitialization { /** * @deprecated - * As of 2.0.0, please use {@link app.Messages} instead. + * As of TeamsJS v2.0.0, please use {@link app.Messages} instead. */ // eslint-disable-next-line @typescript-eslint/no-unused-vars export import Messages = app.Messages; /** * @deprecated - * As of 2.0.0, please use {@link app.FailedReason} instead. + * As of TeamsJS v2.0.0, please use {@link app.FailedReason} instead. */ // eslint-disable-next-line @typescript-eslint/no-unused-vars export import FailedReason = app.FailedReason; /** * @deprecated - * As of 2.0.0, please use {@link app.ExpectedFailureReason} instead. + * As of TeamsJS v2.0.0, please use {@link app.ExpectedFailureReason} instead. */ // eslint-disable-next-line @typescript-eslint/no-unused-vars export import ExpectedFailureReason = app.ExpectedFailureReason; /** * @deprecated - * As of 2.0.0, please use {@link app.IFailedRequest} instead. + * As of TeamsJS v2.0.0, please use {@link app.IFailedRequest} instead. */ export import IFailedRequest = app.IFailedRequest; /** * @deprecated - * As of 2.0.0, please use {@link app.IExpectedFailureRequest} instead. + * As of TeamsJS v2.0.0, please use {@link app.IExpectedFailureRequest} instead. */ export import IExpectedFailureRequest = app.IExpectedFailureRequest; /** * @deprecated - * As of 2.0.0, please use {@link app.notifyAppLoaded app.notifyAppLoaded(): void} instead. + * As of TeamsJS v2.0.0, please use {@link app.notifyAppLoaded app.notifyAppLoaded(): void} instead. * * Notifies the frame that app has loaded and to hide the loading indicator if one is shown. */ @@ -59,7 +59,7 @@ export namespace appInitialization { /** * @deprecated - * As of 2.0.0, please use {@link app.notifySuccess app.notifySuccess(): void} instead. + * As of TeamsJS v2.0.0, please use {@link app.notifySuccess app.notifySuccess(): void} instead. * * Notifies the frame that app initialization is successful and is ready for user interaction. */ @@ -71,7 +71,7 @@ export namespace appInitialization { /** * @deprecated - * As of 2.0.0, please use {@link app.notifyFailure app.notifyFailure(appInitializationFailedRequest: IFailedRequest): void} instead. + * As of TeamsJS v2.0.0, please use {@link app.notifyFailure app.notifyFailure(appInitializationFailedRequest: IFailedRequest): void} instead. * * Notifies the frame that app initialization has failed and to show an error page in its place. * @param appInitializationFailedRequest - The failure request containing the reason for why the app failed @@ -86,7 +86,7 @@ export namespace appInitialization { /** * @deprecated - * As of 2.0.0, please use {@link app.notifyExpectedFailure app.notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void} instead. + * As of TeamsJS v2.0.0, please use {@link app.notifyExpectedFailure app.notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void} instead. * * Notifies the frame that app initialized with some expected errors. * @param expectedFailureRequest - The expected failure request containing the reason and an optional message diff --git a/packages/teams-js/src/public/authentication.ts b/packages/teams-js/src/public/authentication.ts index 2dac282b95..715cfef4d4 100644 --- a/packages/teams-js/src/public/authentication.ts +++ b/packages/teams-js/src/public/authentication.ts @@ -58,7 +58,7 @@ export namespace authentication { let authParams: AuthenticateParameters | undefined; /** * @deprecated - * As of 2.0.0, this function has been deprecated in favor of a Promise-based pattern using {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\} + * As of TeamsJS v2.0.0, this function has been deprecated in favor of a Promise-based pattern using {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\} * * Registers handlers to be called with the result of an authentication flow triggered using {@link authentication.authenticate authentication.authenticate(authenticateParameters?: AuthenticateParameters): void} * @@ -97,7 +97,7 @@ export namespace authentication { export function authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise; /** * @deprecated - * As of 2.0.0, please use {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\} instead. + * As of TeamsJS v2.0.0, please use {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\} instead. * * The documentation for {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\} applies * to this function. @@ -208,7 +208,7 @@ export namespace authentication { export function getAuthToken(authTokenRequest?: AuthTokenRequestParameters): Promise; /** * @deprecated - * As of 2.0.0, please use {@link authentication.getAuthToken authentication.getAuthToken(authTokenRequest: AuthTokenRequestParameters): Promise\} instead. + * As of TeamsJS v2.0.0, please use {@link authentication.getAuthToken authentication.getAuthToken(authTokenRequest: AuthTokenRequestParameters): Promise\} instead. * * The documentation {@link authentication.getAuthToken authentication.getAuthToken(authTokenRequest: AuthTokenRequestParameters): Promise\} applies to this * function as well. The one difference when using this function is that the result is provided in the callbacks in the `authTokenRequest` parameter @@ -272,7 +272,7 @@ export namespace authentication { export function getUser(): Promise; /** * @deprecated - * As of 2.0.0, please use {@link authentication.getUser authentication.getUser(): Promise\} instead. + * As of TeamsJS v2.0.0, please use {@link authentication.getUser authentication.getUser(): Promise\} instead. * * @hidden * Requests the decoded Microsoft Entra user identity on behalf of the app. @@ -527,21 +527,21 @@ export namespace authentication { /** * @deprecated - * As of 2.0.0, this interface has been deprecated in favor of leveraging the `Promise` returned from {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\} + * As of TeamsJS v2.0.0, this interface has been deprecated in favor of leveraging the `Promise` returned from {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\} *------------------------- * Used in {@link AuthenticateParameters} and {@link AuthTokenRequest} */ export interface LegacyCallBacks { /** * @deprecated - * As of 2.0.0, this property has been deprecated in favor of a Promise-based pattern. + * As of TeamsJS v2.0.0, this property has been deprecated in favor of a Promise-based pattern. * * A function that is called if the request succeeds. */ successCallback?: (result: string) => void; /** * @deprecated - * As of 2.0.0, this property has been deprecated in favor of a Promise-based pattern. + * As of TeamsJS v2.0.0, this property has been deprecated in favor of a Promise-based pattern. * * A function that is called if the request fails, with the reason for the failure. */ @@ -578,7 +578,7 @@ export namespace authentication { /** * @deprecated - * As of 2.0.0, please use {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\} and + * As of TeamsJS v2.0.0, please use {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\} and * the associated {@link AuthenticatePopUpParameters} instead. * * @see {@link LegacyCallBacks} @@ -611,7 +611,7 @@ export namespace authentication { /** * @deprecated - * As of 2.0.0, please use {@link AuthTokenRequestParameters} instead. + * As of TeamsJS v2.0.0, please use {@link AuthTokenRequestParameters} instead. */ export type AuthTokenRequest = AuthTokenRequestParameters & LegacyCallBacks; @@ -786,7 +786,7 @@ export namespace authentication { /** * @deprecated - * As of 2.0.0, this interface has been deprecated in favor of a Promise-based pattern. + * As of TeamsJS v2.0.0, this interface has been deprecated in favor of a Promise-based pattern. * @hidden * Describes the UserRequest. Success callback describes how a successful request is handled. * Failure callback describes how a failed request is handled. diff --git a/packages/teams-js/src/public/constants.ts b/packages/teams-js/src/public/constants.ts index 209f008739..5128315a04 100644 --- a/packages/teams-js/src/public/constants.ts +++ b/packages/teams-js/src/public/constants.ts @@ -14,7 +14,7 @@ export enum HostClientType { macos = 'macos', /** * @deprecated - * As of 2.0.0, please use {@link teamsRoomsWindows} instead. + * As of TeamsJS v2.0.0, please use {@link teamsRoomsWindows} instead. */ rigel = 'rigel', /** Represents the client of host, which runs on surface hub devices. */ @@ -144,7 +144,7 @@ export enum DialogDimension { import { AdaptiveCardVersion, ErrorCode, SdkError } from './interfaces'; /** * @deprecated - * As of 2.0.0, please use {@link DialogDimension} instead. + * As of TeamsJS v2.0.0, please use {@link DialogDimension} instead. */ // eslint-disable-next-line @typescript-eslint/no-unused-vars export import TaskModuleDimension = DialogDimension; diff --git a/packages/teams-js/src/public/interfaces.ts b/packages/teams-js/src/public/interfaces.ts index faf4956f69..7215169bd5 100644 --- a/packages/teams-js/src/public/interfaces.ts +++ b/packages/teams-js/src/public/interfaces.ts @@ -279,7 +279,7 @@ export interface ActionInfo { /** * @deprecated - * As of 2.0.0, please use the {@link app.Context} interface and its updated properties instead. + * As of TeamsJS v2.0.0, please use the {@link app.Context} interface and its updated properties instead. * * @remarks * For more details about the updated {@link app.Context} interface, visit the @@ -291,7 +291,7 @@ export interface ActionInfo { export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link ActionInfo | app.Context.actionInfo} instead + * As of TeamsJS v2.0.0, please use {@link ActionInfo | app.Context.actionInfo} instead * * Common information applicable to all content actions */ @@ -299,7 +299,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.TeamInfo.groupId | app.Context.team.groupId} instead + * As of TeamsJS v2.0.0, please use {@link app.TeamInfo.groupId | app.Context.team.groupId} instead * * The Office 365 group ID for the team with which the content is associated. * This field is available only when the identity permission is requested in the manifest. @@ -308,7 +308,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.TeamInfo.internalId | app.Context.team.internalId} instead + * As of TeamsJS v2.0.0, please use {@link app.TeamInfo.internalId | app.Context.team.internalId} instead * * The Microsoft Teams ID for the team with which the content is associated. */ @@ -316,7 +316,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.TeamInfo.displayName | app.Context.team.displayName} instead + * As of TeamsJS v2.0.0, please use {@link app.TeamInfo.displayName | app.Context.team.displayName} instead * * The name for the team with which the content is associated. */ @@ -324,7 +324,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.ChannelInfo.id | app.Context.channel.id} instead + * As of TeamsJS v2.0.0, please use {@link app.ChannelInfo.id | app.Context.channel.id} instead * * The Microsoft Teams ID for the channel with which the content is associated. */ @@ -332,7 +332,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.ChannelInfo.displayName | app.Context.channel.displayName} instead + * As of TeamsJS v2.0.0, please use {@link app.ChannelInfo.displayName | app.Context.channel.displayName} instead * * The name for the channel with which the content is associated. */ @@ -340,7 +340,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.ChannelInfo.membershipType | app.Context.channel.membershipType} instead + * As of TeamsJS v2.0.0, please use {@link app.ChannelInfo.membershipType | app.Context.channel.membershipType} instead * * The type of the channel with which the content is associated. */ @@ -348,7 +348,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.PageInfo.id | app.Context.page.id} instead + * As of TeamsJS v2.0.0, please use {@link app.PageInfo.id | app.Context.page.id} instead * * The developer-defined unique ID for the entity this content points to. */ @@ -356,7 +356,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.PageInfo.subPageId | app.Context.page.subPageId} instead + * As of TeamsJS v2.0.0, please use {@link app.PageInfo.subPageId | app.Context.page.subPageId} instead * * The developer-defined unique ID for the sub-entity this content points to. * This field should be used to restore to a specific state within an entity, @@ -366,7 +366,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.AppInfo.locale | app.Context.app.locale} instead + * As of TeamsJS v2.0.0, please use {@link app.AppInfo.locale | app.Context.app.locale} instead * * The current locale that the user has configured for the app formatted as * languageId-countryId (for example, en-us). @@ -375,7 +375,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.AppInfo.osLocaleInfo | app.Context.app.osLocaleInfo} instead + * As of TeamsJS v2.0.0, please use {@link app.AppInfo.osLocaleInfo | app.Context.app.osLocaleInfo} instead * * More detailed locale info from the user's OS if available. Can be used together with * the @microsoft/globe NPM package to ensure your app respects the user's OS date and @@ -386,7 +386,7 @@ export interface Context { /** * @deprecated * - * As of 2.0.0, please use {@link app.UserInfo.loginHint | app.Context.user.loginHint} or + * As of TeamsJS v2.0.0, please use {@link app.UserInfo.loginHint | app.Context.user.loginHint} or * {@link app.UserInfo.userPrincipalName | app.Context.user.userPrincipalName} instead. * The UPN of the current user. * Because a malicious party can run your content in a browser, this value should @@ -397,7 +397,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.TenantInfo.id | app.Context.user.tenant.id} instead + * As of TeamsJS v2.0.0, please use {@link app.TenantInfo.id | app.Context.user.tenant.id} instead * * The Microsoft Entra tenant ID of the current user. * Because a malicious party can run your content in a browser, this value should @@ -408,7 +408,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.AppInfo.theme | app.Context.app.theme} instead + * As of TeamsJS v2.0.0, please use {@link app.AppInfo.theme | app.Context.app.theme} instead * * The current UI theme. */ @@ -416,7 +416,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.PageInfo.isFullScreen | app.Context.page.isFullScreen} instead + * As of TeamsJS v2.0.0, please use {@link app.PageInfo.isFullScreen | app.Context.page.isFullScreen} instead * * Indication whether the tab is in full-screen mode. */ @@ -424,7 +424,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.TeamInfo.type | app.Context.team.type} instead + * As of TeamsJS v2.0.0, please use {@link app.TeamInfo.type | app.Context.team.type} instead * * The type of the team. */ @@ -432,7 +432,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.SharePointSiteInfo.teamSiteUrl | app.Context.sharePointSite.teamSiteUrl} instead + * As of TeamsJS v2.0.0, please use {@link app.SharePointSiteInfo.teamSiteUrl | app.Context.sharePointSite.teamSiteUrl} instead * * The root SharePoint site associated with the team. */ @@ -440,7 +440,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.SharePointSiteInfo.teamSiteDomain | app.Context.sharePointSite.teamSiteDomain} instead + * As of TeamsJS v2.0.0, please use {@link app.SharePointSiteInfo.teamSiteDomain | app.Context.sharePointSite.teamSiteDomain} instead * * The domain of the root SharePoint site associated with the team. */ @@ -448,7 +448,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.SharePointSiteInfo.teamSitePath | app.Context.sharePointSite.teamSitePath} instead + * As of TeamsJS v2.0.0, please use {@link app.SharePointSiteInfo.teamSitePath | app.Context.sharePointSite.teamSitePath} instead * * The relative path to the SharePoint site associated with the team. */ @@ -456,7 +456,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.ChannelInfo.ownerTenantId | app.Context.channel.ownerTenantId} instead + * As of TeamsJS v2.0.0, please use {@link app.ChannelInfo.ownerTenantId | app.Context.channel.ownerTenantId} instead * * The tenant ID of the host team. */ @@ -464,7 +464,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.ChannelInfo.ownerGroupId | app.Context.channel.ownerGroupId} instead + * As of TeamsJS v2.0.0, please use {@link app.ChannelInfo.ownerGroupId | app.Context.channel.ownerGroupId} instead * * The Microsoft Entra group ID of the host team. */ @@ -472,7 +472,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.ChannelInfo.relativeUrl | app.Context.channel.relativeUrl} instead + * As of TeamsJS v2.0.0, please use {@link app.ChannelInfo.relativeUrl | app.Context.channel.relativeUrl} instead * * The relative path to the SharePoint folder associated with the channel. */ @@ -480,7 +480,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.AppHostInfo.sessionId | app.Context.app.host.sessionId} instead + * As of TeamsJS v2.0.0, please use {@link app.AppHostInfo.sessionId | app.Context.app.host.sessionId} instead * * Unique ID for the current Teams session for use in correlating telemetry data. */ @@ -488,7 +488,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.TeamInfo.userRole | app.Context.team.userRole} instead + * As of TeamsJS v2.0.0, please use {@link app.TeamInfo.userRole | app.Context.team.userRole} instead * * The user's role in the team. * Because a malicious party can run your content in a browser, this value should @@ -498,7 +498,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.ChatInfo.id | app.Context.chat.id} instead + * As of TeamsJS v2.0.0, please use {@link app.ChatInfo.id | app.Context.chat.id} instead * * The Microsoft Teams ID for the chat with which the content is associated. */ @@ -506,7 +506,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.UserInfo.loginHint | app.Context.user.loginHint} instead + * As of TeamsJS v2.0.0, please use {@link app.UserInfo.loginHint | app.Context.user.loginHint} instead * * A value suitable for use as a login_hint when authenticating with Microsoft Entra ID. * Because a malicious party can run your content in a browser, this value should @@ -517,7 +517,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.UserInfo.userPrincipalName | app.Context.user.userPrincipalName} instead + * As of TeamsJS v2.0.0, please use {@link app.UserInfo.userPrincipalName | app.Context.user.userPrincipalName} instead * * The UPN of the current user. This may be an externally-authenticated UPN (e.g., guest users). * Because a malicious party run your content in a browser, this value should @@ -528,7 +528,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.UserInfo.id | app.Context.user.id} instead + * As of TeamsJS v2.0.0, please use {@link app.UserInfo.id | app.Context.user.id} instead * * The Microsoft Entra object ID of the current user. * Because a malicious party run your content in a browser, this value should @@ -539,7 +539,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.TeamInfo.isArchived | app.Context.team.isArchived} instead + * As of TeamsJS v2.0.0, please use {@link app.TeamInfo.isArchived | app.Context.team.isArchived} instead * * Indicates whether team is archived. * Apps should use this as a signal to prevent any changes to content associated with archived teams. @@ -548,7 +548,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.AppHostInfo.name | app.Context.app.host.name} instead + * As of TeamsJS v2.0.0, please use {@link app.AppHostInfo.name | app.Context.app.host.name} instead * * The name of the host client. Possible values are: Office, Orange, Outlook, Teams */ @@ -556,7 +556,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.AppHostInfo.clientType | app.Context.app.host.clientType} instead + * As of TeamsJS v2.0.0, please use {@link app.AppHostInfo.clientType | app.Context.app.host.clientType} instead * * The type of the host client. Possible values are : android, ios, web, desktop, rigel(deprecated, use teamsRoomsWindows instead), * surfaceHub, teamsRoomsWindows, teamsRoomsAndroid, teamsPhones, teamsDisplays @@ -565,7 +565,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.PageInfo.frameContext | app.Context.page.frameContext} instead + * As of TeamsJS v2.0.0, please use {@link app.PageInfo.frameContext | app.Context.page.frameContext} instead * * The context where tab url is loaded (content, task, setting, remove, sidePanel) */ @@ -573,7 +573,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.Context | app.Context.sharepoint} instead + * As of TeamsJS v2.0.0, please use {@link app.Context | app.Context.sharepoint} instead * * SharePoint context. This is only available when hosted in SharePoint. */ @@ -581,7 +581,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.TenantInfo.teamsSku | app.Context.tenant.teamsSku} instead + * As of TeamsJS v2.0.0, please use {@link app.TenantInfo.teamsSku | app.Context.tenant.teamsSku} instead * * The type of license for the current users tenant. */ @@ -589,7 +589,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.UserInfo.licenseType | app.Context.user.licenseType} instead + * As of TeamsJS v2.0.0, please use {@link app.UserInfo.licenseType | app.Context.user.licenseType} instead * * The license type for the current user. */ @@ -597,7 +597,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.AppInfo.parentMessageId | app.Context.app.parentMessageId} instead + * As of TeamsJS v2.0.0, please use {@link app.AppInfo.parentMessageId | app.Context.app.parentMessageId} instead * * The ID of the parent message from which this task module was launched. * This is only available in task modules launched from bot cards. @@ -606,7 +606,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.AppHostInfo.ringId | app.Context.app.host.ringId} instead + * As of TeamsJS v2.0.0, please use {@link app.AppHostInfo.ringId | app.Context.app.host.ringId} instead * * Current ring ID */ @@ -614,7 +614,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.AppInfo.sessionId | app.Context.app.sessionId} instead + * As of TeamsJS v2.0.0, please use {@link app.AppInfo.sessionId | app.Context.app.sessionId} instead * * Unique ID for the current session for use in correlating telemetry data. A session corresponds to the lifecycle of an app. A new session begins upon the creation of a webview (on Teams mobile) or iframe (in Teams desktop) hosting the app, and ends when it is destroyed. */ @@ -622,7 +622,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.AppInfo.appLaunchId | app.Context.app.appLaunchId} instead + * As of TeamsJS v2.0.0, please use {@link app.AppInfo.appLaunchId | app.Context.app.appLaunchId} instead * * ID for the current visible app which is different for across cached sessions. Used for correlating telemetry data`` */ @@ -630,7 +630,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.UserInfo.isCallingAllowed | app.Context.user.isCallingAllowed} instead + * As of TeamsJS v2.0.0, please use {@link app.UserInfo.isCallingAllowed | app.Context.user.isCallingAllowed} instead * * Represents whether calling is allowed for the current logged in User */ @@ -638,7 +638,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.UserInfo.isPSTNCallingAllowed | app.Context.user.isPSTNCallingAllowed} instead + * As of TeamsJS v2.0.0, please use {@link app.UserInfo.isPSTNCallingAllowed | app.Context.user.isPSTNCallingAllowed} instead * * Represents whether PSTN calling is allowed for the current logged in User */ @@ -646,7 +646,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.MeetingInfo.id | app.Context.meeting.id} instead + * As of TeamsJS v2.0.0, please use {@link app.MeetingInfo.id | app.Context.meeting.id} instead * * Meeting Id used by tab when running in meeting context */ @@ -654,7 +654,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.ChannelInfo.defaultOneNoteSectionId | app.Context.channel.defaultOneNoteSectionId} instead + * As of TeamsJS v2.0.0, please use {@link app.ChannelInfo.defaultOneNoteSectionId | app.Context.channel.defaultOneNoteSectionId} instead * * The OneNote section ID that is linked to the channel. */ @@ -662,7 +662,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.PageInfo.isMultiWindow | app.Context.page.isMultiWindow} instead + * As of TeamsJS v2.0.0, please use {@link app.PageInfo.isMultiWindow | app.Context.page.isMultiWindow} instead * * Indication whether the tab is in a pop out window */ @@ -670,7 +670,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.PageInfo.isBackgroundLoad | app.Context.page.isBackgroundLoad} instead + * As of TeamsJS v2.0.0, please use {@link app.PageInfo.isBackgroundLoad | app.Context.page.isBackgroundLoad} instead * * Indication whether the tab is being loaded in the background */ @@ -678,7 +678,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.AppInfo.iconPositionVertical | app.Context.app.iconPositionVertical} instead + * As of TeamsJS v2.0.0, please use {@link app.AppInfo.iconPositionVertical | app.Context.app.iconPositionVertical} instead * * Personal app icon y coordinate position */ @@ -686,7 +686,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.PageInfo.sourceOrigin | app.Context.page.sourceOrigin} instead + * As of TeamsJS v2.0.0, please use {@link app.PageInfo.sourceOrigin | app.Context.page.sourceOrigin} instead * * Source origin from where the tab is opened */ @@ -694,7 +694,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.AppInfo.userClickTime | app.Context.app.userClickTime} instead + * As of TeamsJS v2.0.0, please use {@link app.AppInfo.userClickTime | app.Context.app.userClickTime} instead * * Time when the user clicked on the tab */ @@ -702,7 +702,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.TeamInfo.templateId | app.Context.team.templateId} instead + * As of TeamsJS v2.0.0, please use {@link app.TeamInfo.templateId | app.Context.team.templateId} instead * * Team Template ID if there was a Team Template associated with the creation of the team. */ @@ -710,7 +710,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.AppInfo.userFileOpenPreference | app.Context.app.userFileOpenPreference} instead + * As of TeamsJS v2.0.0, please use {@link app.AppInfo.userFileOpenPreference | app.Context.app.userFileOpenPreference} instead * * Where the user prefers the file to be opened from by default during file open */ @@ -718,7 +718,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.UserInfo.displayName | app.Context.user.displayName} instead + * As of TeamsJS v2.0.0, please use {@link app.UserInfo.displayName | app.Context.user.displayName} instead * * The address book name of the current user. */ @@ -726,7 +726,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.SharePointSiteInfo.teamSiteId | app.Context.sharePointSite.teamSiteId} instead + * As of TeamsJS v2.0.0, please use {@link app.SharePointSiteInfo.teamSiteId | app.Context.sharePointSite.teamSiteId} instead * * Teamsite ID, aka sharepoint site id. */ @@ -734,7 +734,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.SharePointSiteInfo.mySiteDomain | app.Context.sharePointSite.mySiteDomain} instead + * As of TeamsJS v2.0.0, please use {@link app.SharePointSiteInfo.mySiteDomain | app.Context.sharePointSite.mySiteDomain} instead * * The SharePoint my site domain associated with the user. */ @@ -742,7 +742,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.SharePointSiteInfo.mySitePath | app.Context.sharePointSite.mySitePath} instead + * As of TeamsJS v2.0.0, please use {@link app.SharePointSiteInfo.mySitePath | app.Context.sharePointSite.mySitePath} instead * * The SharePoint relative path to the current users mysite */ @@ -750,7 +750,7 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.Context.dialogParameters} instead + * As of TeamsJS v2.0.0, please use {@link app.Context.dialogParameters} instead * * When `processActionCommand` activates a dialog, this dialog should automatically fill in some fields with information. This information comes from M365 and is given to `processActionCommand` as `extractedParameters`. * App developers need to use these `extractedParameters` in their dialog. @@ -781,7 +781,7 @@ export interface ShareDeepLinkParameters { /** * @deprecated - * As of 2.0.0, please use {@link ShareDeepLinkParameters} instead. + * As of TeamsJS v2.0.0, please use {@link ShareDeepLinkParameters} instead. */ export interface DeepLinkParameters { /** @@ -934,7 +934,7 @@ export interface DialogInfo { /** * @deprecated - * As of 2.0.0, please use {@link DialogInfo} instead. + * As of TeamsJS v2.0.0, please use {@link DialogInfo} instead. */ export type TaskInfo = DialogInfo; @@ -975,7 +975,7 @@ export interface FrameInfo { /** * @deprecated - * As of 2.0.0, please use {@link FrameInfo} instead. + * As of TeamsJS v2.0.0, please use {@link FrameInfo} instead. */ export type FrameContext = FrameInfo; diff --git a/packages/teams-js/src/public/monetization.ts b/packages/teams-js/src/public/monetization.ts index 460b0ba923..f9a56d5f93 100644 --- a/packages/teams-js/src/public/monetization.ts +++ b/packages/teams-js/src/public/monetization.ts @@ -54,7 +54,7 @@ export namespace monetization { export function openPurchaseExperience(planInfo?: PlanInfo): Promise; /** * @deprecated - * As of 2.0.0, please use {@link monetization.openPurchaseExperience monetization.openPurchaseExperience(planInfo?: PlanInfo): Promise\} instead. + * As of TeamsJS v2.0.0, please use {@link monetization.openPurchaseExperience monetization.openPurchaseExperience(planInfo?: PlanInfo): Promise\} instead. * * @hidden * Open dialog to start user's purchase experience diff --git a/packages/teams-js/src/public/navigation.ts b/packages/teams-js/src/public/navigation.ts index c5aecf69a0..030fbae79a 100644 --- a/packages/teams-js/src/public/navigation.ts +++ b/packages/teams-js/src/public/navigation.ts @@ -24,7 +24,7 @@ const navigationTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_1; export type onCompleteHandlerFunctionType = (status: boolean, reason?: string) => void; /** * @deprecated - * As of 2.0.0, please use {@link pages.returnFocus pages.returnFocus(navigateForward?: boolean): void} instead. + * As of TeamsJS v2.0.0, please use {@link pages.returnFocus pages.returnFocus(navigateForward?: boolean): void} instead. * * Return focus to the main Teams app. Will focus search bar if navigating foward and app bar if navigating back. * @@ -39,7 +39,7 @@ export function returnFocus(navigateForward?: boolean): void { /** * @deprecated - * As of 2.0.0, please use {@link pages.tabs.navigateToTab pages.tabs.navigateToTab(tabInstance: TabInstance): Promise\} instead. + * As of TeamsJS v2.0.0, please use {@link pages.tabs.navigateToTab pages.tabs.navigateToTab(tabInstance: TabInstance): Promise\} instead. * * Navigates the Microsoft Teams app to the specified tab instance. * @@ -63,7 +63,7 @@ export function navigateToTab(tabInstance: TabInstance, onComplete?: onCompleteH /** * @deprecated - * As of 2.0.0, please use {@link pages.navigateCrossDomain pages.navigateCrossDomain(url: string): Promise\} instead. + * As of TeamsJS v2.0.0, please use {@link pages.navigateCrossDomain pages.navigateCrossDomain(url: string): Promise\} instead. * * Navigates the frame to a new cross-domain URL. The domain of this URL must match at least one of the * valid domains specified in the validDomains block of the manifest; otherwise, an exception will be @@ -100,7 +100,7 @@ export function navigateCrossDomain(url: string, onComplete?: onCompleteHandlerF /** * @deprecated - * As of 2.0.0, please use {@link pages.backStack.navigateBack pages.backStack.navigateBack(): Promise\} instead. + * As of TeamsJS v2.0.0, please use {@link pages.backStack.navigateBack pages.backStack.navigateBack(): Promise\} instead. * * Navigates back in the Teams client. * See registerBackButtonHandler for more information on when it's appropriate to use this method. diff --git a/packages/teams-js/src/public/pages.ts b/packages/teams-js/src/public/pages.ts index ab4d09ae32..53b8afb800 100644 --- a/packages/teams-js/src/public/pages.ts +++ b/packages/teams-js/src/public/pages.ts @@ -1018,7 +1018,7 @@ export namespace pages { export interface NavigateWithinAppParams { /** * The developer-defined unique ID for the page defined in the manifest or when first configuring - * the page. (Known as {@linkcode Context.entityId} prior to TeamsJS v.2.0.0) + * the page. (Known as {@linkcode Context.entityId} prior to TeamsJS v2.0.0) */ pageId: string; diff --git a/packages/teams-js/src/public/people.ts b/packages/teams-js/src/public/people.ts index eff10102f6..9fc9f0d9bc 100644 --- a/packages/teams-js/src/public/people.ts +++ b/packages/teams-js/src/public/people.ts @@ -30,7 +30,7 @@ export namespace people { export function selectPeople(peoplePickerInputs?: PeoplePickerInputs): Promise; /** * @deprecated - * As of 2.0.0, please use {@link people.selectPeople people.selectPeople(peoplePickerInputs?: PeoplePickerInputs): Promise\} instead. + * As of TeamsJS v2.0.0, please use {@link people.selectPeople people.selectPeople(peoplePickerInputs?: PeoplePickerInputs): Promise\} instead. * * Launches a people picker and allows the user to select one or more people from the list * 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 diff --git a/packages/teams-js/src/public/publicAPIs.ts b/packages/teams-js/src/public/publicAPIs.ts index 4578b527fe..60895c0953 100644 --- a/packages/teams-js/src/public/publicAPIs.ts +++ b/packages/teams-js/src/public/publicAPIs.ts @@ -40,7 +40,7 @@ export type registerFullScreenHandlerFunctionType = (isFullScreen: boolean) => v export type registerOnThemeChangeHandlerFunctionType = (theme: string) => void; /** * @deprecated - * As of 2.0.0, please use {@link app.initialize app.initialize(validMessageOrigins?: string[]): Promise\} instead. + * As of TeamsJS v2.0.0, please use {@link app.initialize app.initialize(validMessageOrigins?: string[]): Promise\} instead. * * Initializes the library. This must be called before any other SDK calls * but after the frame is loaded successfully. @@ -61,7 +61,7 @@ export function initialize(callback?: callbackFunctionType, validMessageOrigins? /** * @deprecated - * As of 2.0.0, please use {@link teamsCore.enablePrintCapability teamsCore.enablePrintCapability(): void} instead. + * As of TeamsJS v2.0.0, please use {@link teamsCore.enablePrintCapability teamsCore.enablePrintCapability(): void} instead. * * Enable print capability to support printing page using Ctrl+P and cmd+P */ @@ -71,7 +71,7 @@ export function enablePrintCapability(): void { /** * @deprecated - * As of 2.0.0, please use {@link teamsCore.print teamsCore.print(): void} instead. + * As of TeamsJS v2.0.0, please use {@link teamsCore.print teamsCore.print(): void} instead. * * Default print handler */ @@ -81,7 +81,7 @@ export function print(): void { /** * @deprecated - * As of 2.0.0, please use {@link app.getContext app.getContext(): Promise\} instead. + * As of TeamsJS v2.0.0, please use {@link app.getContext app.getContext(): Promise\} instead. * * Retrieves the current context the frame is running in. * @@ -104,7 +104,7 @@ export function getContext(callback: getContextCallbackFunctionType): void { /** * @deprecated - * As of 2.0.0, please use {@link app.registerOnThemeChangeHandler app.registerOnThemeChangeHandler(handler: registerOnThemeChangeHandlerFunctionType): void} instead. + * As of TeamsJS v2.0.0, please use {@link app.registerOnThemeChangeHandler app.registerOnThemeChangeHandler(handler: registerOnThemeChangeHandlerFunctionType): void} instead. * * Registers a handler for theme changes. * Only one handler can be registered at a time. A subsequent registration replaces an existing registration. @@ -120,7 +120,7 @@ export function registerOnThemeChangeHandler(handler: registerOnThemeChangeHandl /** * @deprecated - * As of 2.0.0, please use {@link pages.registerFullScreenHandler pages.registerFullScreenHandler(handler: registerFullScreenHandlerFunctionType): void} instead. + * As of TeamsJS v2.0.0, please use {@link pages.registerFullScreenHandler pages.registerFullScreenHandler(handler: registerFullScreenHandlerFunctionType): void} instead. * * Registers a handler for changes from or to full-screen view for a tab. * Only one handler can be registered at a time. A subsequent registration replaces an existing registration. @@ -138,7 +138,7 @@ export function registerFullScreenHandler(handler: registerFullScreenHandlerFunc /** * @deprecated - * As of 2.0.0, please use {@link pages.appButton.onClick pages.appButton.onClick(handler: callbackFunctionType): void} instead. + * As of TeamsJS v2.0.0, please use {@link pages.appButton.onClick pages.appButton.onClick(handler: callbackFunctionType): void} instead. * * Registers a handler for clicking the app button. * Only one handler can be registered at a time. A subsequent registration replaces an existing registration. @@ -156,7 +156,7 @@ export function registerAppButtonClickHandler(handler: callbackFunctionType): vo /** * @deprecated - * As of 2.0.0, please use {@link pages.appButton.onHoverEnter pages.appButton.onHoverEnter(handler: callbackFunctionType): void} instead. + * As of TeamsJS v2.0.0, please use {@link pages.appButton.onHoverEnter pages.appButton.onHoverEnter(handler: callbackFunctionType): void} instead. * * Registers a handler for entering hover of the app button. * Only one handler can be registered at a time. A subsequent registration replaces an existing registration. @@ -174,7 +174,7 @@ export function registerAppButtonHoverEnterHandler(handler: callbackFunctionType /** * @deprecated - * As of 2.0.0, please use {@link pages.appButton.onHoverLeave pages.appButton.onHoverLeave(handler: callbackFunctionType): void} instead. + * As of TeamsJS v2.0.0, please use {@link pages.appButton.onHoverLeave pages.appButton.onHoverLeave(handler: callbackFunctionType): void} instead. * * Registers a handler for exiting hover of the app button. * Only one handler can be registered at a time. A subsequent registration replaces an existing registration. @@ -192,7 +192,7 @@ export function registerAppButtonHoverLeaveHandler(handler: callbackFunctionType /** * @deprecated - * As of 2.0.0, please use {@link pages.backStack.registerBackButtonHandler pages.backStack.registerBackButtonHandler(handler: registerBackButtonHandlerFunctionType): void} instead. + * As of TeamsJS v2.0.0, please use {@link pages.backStack.registerBackButtonHandler pages.backStack.registerBackButtonHandler(handler: registerBackButtonHandlerFunctionType): void} instead. * * Registers a handler for user presses of the Team client's back button. Experiences that maintain an internal * navigation stack should use this handler to navigate the user back within their frame. If an app finds @@ -210,7 +210,7 @@ export function registerBackButtonHandler(handler: registerBackButtonHandlerFunc /** * @deprecated - * As of 2.0.0, please use {@link teamsCore.registerOnLoadHandler teamsCore.registerOnLoadHandler(handler: (context: LoadContext) => void): void} instead. + * As of TeamsJS v2.0.0, please use {@link teamsCore.registerOnLoadHandler teamsCore.registerOnLoadHandler(handler: (context: LoadContext) => void): void} instead. * * @hidden * Registers a handler to be called when the page has been requested to load. @@ -226,7 +226,7 @@ export function registerOnLoadHandler(handler: (context: LoadContext) => void): /** * @deprecated - * As of 2.0.0, please use {@link teamsCore.registerBeforeUnloadHandler teamsCore.registerBeforeUnloadHandler(handler: (readyToUnload: callbackFunctionType) => boolean): void} instead. + * As of TeamsJS v2.0.0, please use {@link teamsCore.registerBeforeUnloadHandler teamsCore.registerBeforeUnloadHandler(handler: (readyToUnload: callbackFunctionType) => boolean): void} instead. * * @hidden * Registers a handler to be called before the page is unloaded. @@ -243,7 +243,7 @@ export function registerBeforeUnloadHandler(handler: (readyToUnload: callbackFun /** * @deprecated - * As of 2.0.0, please use {@link pages.registerFocusEnterHandler pages.registerFocusEnterHandler(handler: (navigateForward: boolean) => void): void} instead. + * As of TeamsJS v2.0.0, please use {@link pages.registerFocusEnterHandler pages.registerFocusEnterHandler(handler: (navigateForward: boolean) => void): void} instead. * * @hidden * Registers a handler when focus needs to be passed from teams to the place of choice on app. @@ -261,7 +261,7 @@ export function registerFocusEnterHandler(handler: (navigateForward: boolean) => /** * @deprecated - * As of 2.0.0, please use {@link pages.config.registerChangeConfigHandler pages.config.registerChangeConfigHandler(handler: callbackFunctionType): void} instead. + * As of TeamsJS v2.0.0, please use {@link pages.config.registerChangeConfigHandler pages.config.registerChangeConfigHandler(handler: callbackFunctionType): void} instead. * * Registers a handler for when the user reconfigurated tab. * @@ -278,7 +278,7 @@ export function registerChangeSettingsHandler(handler: callbackFunctionType): vo /** * @deprecated - * As of 2.0.0, please use {@link pages.tabs.getTabInstances pages.tabs.getTabInstances(tabInstanceParameters?: TabInstanceParameters): Promise\} instead. + * As of TeamsJS v2.0.0, please use {@link pages.tabs.getTabInstances pages.tabs.getTabInstances(tabInstanceParameters?: TabInstanceParameters): Promise\} instead. * * Allows an app to retrieve for this user tabs that are owned by this app. * If no TabInstanceParameters are passed, the app defaults to favorite teams and favorite channels. @@ -301,7 +301,7 @@ export function getTabInstances( /** * @deprecated - * As of 2.0.0, please use {@link pages.tabs.getMruTabInstances pages.tabs.getMruTabInstances(tabInstanceParameters?: TabInstanceParameters): Promise\} instead. + * As of TeamsJS v2.0.0, please use {@link pages.tabs.getMruTabInstances pages.tabs.getMruTabInstances(tabInstanceParameters?: TabInstanceParameters): Promise\} instead. * * Allows an app to retrieve the most recently used tabs for this user. * @@ -323,7 +323,7 @@ export function getMruTabInstances( /** * @deprecated - * As of 2.0.0, please use {@link pages.shareDeepLink pages.shareDeepLink(deepLinkParameters: DeepLinkParameters): void} instead. + * As of TeamsJS v2.0.0, please use {@link pages.shareDeepLink pages.shareDeepLink(deepLinkParameters: DeepLinkParameters): void} instead. * * Shares a deep link that a user can use to navigate back to a specific state in this page. * @@ -372,7 +372,7 @@ export function executeDeepLink(deepLink: string, onComplete?: executeDeepLinkOn /** * @deprecated - * As of 2.0.0, please use {@link pages.setCurrentFrame pages.setCurrentFrame(frameInfo: FrameInfo): void} instead. + * As of TeamsJS v2.0.0, please use {@link pages.setCurrentFrame pages.setCurrentFrame(frameInfo: FrameInfo): void} instead. * * Set the current Frame Context * @@ -387,7 +387,7 @@ export function setFrameContext(frameContext: FrameContext): void { /** * @deprecated - * As of 2.0.0, please use {@link pages.initializeWithFrameContext pages.initializeWithFrameContext(frameInfo: FrameInfo, callback?: callbackFunctionType, validMessageOrigins?: string[],): void} instead. + * As of TeamsJS v2.0.0, please use {@link pages.initializeWithFrameContext pages.initializeWithFrameContext(frameInfo: FrameInfo, callback?: callbackFunctionType, validMessageOrigins?: string[],): void} instead. * * Initialize with FrameContext * diff --git a/packages/teams-js/src/public/settings.ts b/packages/teams-js/src/public/settings.ts index 5692d64138..d057e6595b 100644 --- a/packages/teams-js/src/public/settings.ts +++ b/packages/teams-js/src/public/settings.ts @@ -12,7 +12,7 @@ const settingsTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_1; /** * @deprecated - * As of 2.0.0, please use {@link pages.config} namespace instead. + * As of TeamsJS v2.0.0, please use {@link pages.config} namespace instead. * * Namespace to interact with the settings-specific part of the SDK. * This object is usable only on the settings frame. @@ -29,7 +29,7 @@ export namespace settings { /** * @deprecated - * As of 2.0.0, please use {@link pages.config.Config} instead. + * As of TeamsJS v2.0.0, please use {@link pages.config.Config} instead. * @remarks * Renamed to config in pages.Config */ @@ -37,7 +37,7 @@ export namespace settings { /** * @deprecated - * As of 2.0.0, please use {@link pages.config.SaveEvent} instead. + * As of TeamsJS v2.0.0, please use {@link pages.config.SaveEvent} instead. * @remarks * See pages.SaveEvent */ @@ -45,7 +45,7 @@ export namespace settings { /** * @deprecated - * As of 2.0.0, please use {@link pages.config.RemoveEvent} instead. + * As of TeamsJS v2.0.0, please use {@link pages.config.RemoveEvent} instead. * @remarks * See pages.RemoveEvent */ @@ -53,7 +53,7 @@ export namespace settings { /** * @deprecated - * As of 2.0.0, please use {@link pages.config.SaveParameters} instead. + * As of TeamsJS v2.0.0, please use {@link pages.config.SaveParameters} instead. * @remarks * See pages.SaveParameters */ @@ -62,7 +62,7 @@ export namespace settings { /** * @deprecated - * As of 2.0.0, please use {@link pages.config.setValidityState pages.config.setValidityState(validityState: boolean): void} instead. + * As of TeamsJS v2.0.0, please use {@link pages.config.setValidityState pages.config.setValidityState(validityState: boolean): void} instead. * * Sets the validity state for the settings. * The initial value is false, so the user cannot save the settings until this is called with true. @@ -78,7 +78,7 @@ export namespace settings { /** * @deprecated - * As of 2.0.0, please use {@link pages.getConfig pages.getConfig(): Promise\} instead. + * As of TeamsJS v2.0.0, please use {@link pages.getConfig pages.getConfig(): Promise\} instead. * * Gets the settings for the current instance. * @@ -101,7 +101,7 @@ export namespace settings { /** * @deprecated - * As of 2.0.0, please use {@link pages.config.setConfig pages.config.setConfig(instanceSettings: Config): Promise\} instead. + * As of TeamsJS v2.0.0, please use {@link pages.config.setConfig pages.config.setConfig(instanceSettings: Config): Promise\} instead. * * Sets the settings for the current instance. * This is an asynchronous operation; calls to getSettings are not guaranteed to reflect the changed state. @@ -125,7 +125,7 @@ export namespace settings { /** * @deprecated - * As of 2.0.0, please use {@link pages.config.registerOnSaveHandler pages.config.registerOnSaveHandler(handler: registerOnSaveHandlerFunctionType): void} instead. + * As of TeamsJS v2.0.0, please use {@link pages.config.registerOnSaveHandler pages.config.registerOnSaveHandler(handler: registerOnSaveHandlerFunctionType): void} instead. * * Registers a handler for when the user attempts to save the settings. This handler should be used * to create or update the underlying resource powering the content. @@ -143,7 +143,7 @@ export namespace settings { /** * @deprecated - * As of 2.0.0, please use {@link pages.config.registerOnRemoveHandler pages.config.registerOnRemoveHandler(handler: registerOnRemoveHandlerFunctionType): void} instead. + * As of TeamsJS v2.0.0, please use {@link pages.config.registerOnRemoveHandler pages.config.registerOnRemoveHandler(handler: registerOnRemoveHandlerFunctionType): void} instead. * * Registers a handler for user attempts to remove content. This handler should be used * to remove the underlying resource powering the content. diff --git a/packages/teams-js/src/public/sharing.ts b/packages/teams-js/src/public/sharing.ts index 8bfb3b0faa..6e87546118 100644 --- a/packages/teams-js/src/public/sharing.ts +++ b/packages/teams-js/src/public/sharing.ts @@ -78,7 +78,7 @@ export namespace sharing { export function shareWebContent(shareWebContentRequest: IShareRequest): Promise; /** * @deprecated - * As of 2.0.0, please use {@link sharing.shareWebContent sharing.shareWebContent(shareWebContentRequest: IShareRequest\): Promise\} instead. + * As of TeamsJS v2.0.0, please use {@link sharing.shareWebContent sharing.shareWebContent(shareWebContentRequest: IShareRequest\): Promise\} instead. * * Feature is under development * Opens a share dialog for web content diff --git a/packages/teams-js/src/public/tasks.ts b/packages/teams-js/src/public/tasks.ts index bfac3be1d8..ffd84ee967 100644 --- a/packages/teams-js/src/public/tasks.ts +++ b/packages/teams-js/src/public/tasks.ts @@ -17,7 +17,7 @@ const tasksTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_1; /** * @deprecated - * As of 2.0.0, please use {@link dialog} namespace instead. + * As of TeamsJS v2.0.0, please use {@link dialog} namespace instead. * * Namespace to interact with the task module-specific part of the SDK. * This object is usable only on the content frame. @@ -69,7 +69,7 @@ export namespace tasks { /** * @deprecated - * As of 2.0.0, please use {@link dialog.update.resize dialog.update.resize(dimensions: DialogSize): void} instead. + * As of TeamsJS v2.0.0, please use {@link dialog.update.resize dialog.update.resize(dimensions: DialogSize): void} instead. * * Update height/width task info properties. * From 67fd7ceef4da763d476b290f816ce209c61db0c0 Mon Sep 17 00:00:00 2001 From: Shreyas Date: Thu, 23 May 2024 12:52:47 -0700 Subject: [PATCH 11/12] Changefile --- ...soft-teams-js-1ad0d077-794c-4213-aa67-eed6b8c3ec75.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/@microsoft-teams-js-1ad0d077-794c-4213-aa67-eed6b8c3ec75.json diff --git a/change/@microsoft-teams-js-1ad0d077-794c-4213-aa67-eed6b8c3ec75.json b/change/@microsoft-teams-js-1ad0d077-794c-4213-aa67-eed6b8c3ec75.json new file mode 100644 index 0000000000..dd746c5ab0 --- /dev/null +++ b/change/@microsoft-teams-js-1ad0d077-794c-4213-aa67-eed6b8c3ec75.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "Added a small capability which returns the host name where the app is hosted.", + "packageName": "@microsoft/teams-js", + "email": "shrshinde@microsoft.com", + "dependentChangeType": "patch" +} From 2405520b64890d8fad5283190cd2207595fcd1eb Mon Sep 17 00:00:00 2001 From: alexneyman-MSFT <112656629+alexneyman-MSFT@users.noreply.github.com> Date: Fri, 24 May 2024 20:18:05 -0400 Subject: [PATCH 12/12] Add react router for navigation testing (#2275) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add react router for navigation testing * Removing beta tag - Vikramtha/update pages current app (#2283) * Removed beta tage on Pages.currentApp namespace and APIs * Added changefile * Update change/@microsoft-teams-js-51421b73-089f-43de-9076-75563e1f064c.json --------- Co-authored-by: Trevor Harris * Private MessageChannels: split capability and add dataLayer.getDataLayerPort (#2277) Update Message Channel capability to support sub capabilities, add data layer capability with getDataLayerPort --------- Co-authored-by: sumathin Co-authored-by: sumathin Co-authored-by: Trevor Harris * Exported Const Enum Backout (#2285) * backed out all exported const enums * Add release yaml (#2274) * add sdf release yaml --------- Co-authored-by: jadahiya-MSFT <95651173+jadahiya-MSFT@users.noreply.github.com> Co-authored-by: Trevor Harris * Add description for pop-up auth window. (#2291) * Update comment * Update changefile * Adding API to support external app authenticate with Power Platform Connector Plugins (#2272) * Adding PPC auth * Adding PPCauth UTs * adding change file * Resolving comments * Resolving comments * Modify hasScriptTags function to handle encoded Input * Modify hasScriptTags function to handle encoded Input * updating default input * Modify hasScriptTags function to handle encoded Input * adding telemetry tag for ppc auth * Removing pluginId and adding unit tests * Changing url to string before passign to psotmessage * Removing regualr expression for html entities * Removing regualr expression for html entities * Modifying comments * Modifying comments * Resolving comments * Resolving comments --------- Co-authored-by: Lakhveer Kaur Co-authored-by: Erin * Turn webStorage capability into a "real" capability (#2289) * Webstorage becomes capability * Update webstorage in test app * Update webstorage test json * Add changefile * Test updates * Test updates * Final test updates * Helpful util * Empty json test file * Send `validMessageOrigins` to `parentWindow` for verification. (#2293) * Update webStorage.json to not be blank, but almost blank (#2294) * Not blank, but almost blank * Updated * Add webstorage E2E tests (#2295) * Publish android artifacts (#2284) * Publish android artifacts * Use 1ES publishing steps * task names * Use updated artifact location * Add job attempt * Cleanup configuration files (#2296) * Added in new valid domains for Copilot Chat (#2287) * Added in new valid domains for Copilot Chat * Added in changefile --------- Co-authored-by: AE ( ͡ಠ ʖ̯ ͡ಠ) <36546967+AE-MS@users.noreply.github.com> * Trharris/authenticate https (#2270) * Restrict authentication.authenticate to only accept https urls * Create @microsoft-teams-js-40968a44-8220-4162-a289-038e99f5bee3.json * Updated based on PR feedback * Updated to use new validation functions and added(?) support for URL encoded strings * abstract out the auth code's use of the a tag and then add tests to make sure URL encoded partial urls work correctly * Re-order imports * Updated based on PR feedback --------- Co-authored-by: AE ( ͡ಠ ʖ̯ ͡ಠ) <36546967+AE-MS@users.noreply.github.com> * Fixed incorrect API telemetry label for Pages_NavigateToApp API (#2299) * Fix incorrect API telemetry label for Pages_NavigateToApp API * update * Update @microsoft-teams-js-d2040181-a9a1-42d2-9080-35acb3a380cd.json --------- Co-authored-by: AE ( ͡ಠ ʖ̯ ͡ಠ) <36546967+AE-MS@users.noreply.github.com> * Update sdf-release.yml for Azure Pipelines (#2292) * Update sdf-release.yml for Azure Pipelines * Update sdf-release.yml for Azure Pipelines * Update custom API test (#2282) Co-authored-by: sthousto Co-authored-by: Trevor Harris * Upgrade `pnpm` to v9 (#2301) * Initial commit * Update ci * Update ci * remove deprecated sub dependencies * Specify exact version in ci * Update .npmrc location in release helper scripts (#2303) * Update .npmrc location * Changefile * Update @microsoft-teams-js-b63da2d9-3e02-4b83-9664-78aa8f49c713.json * use new scripts for onebranch pipelines --------- Co-authored-by: AE ( ͡ಠ ʖ̯ ͡ಠ) <36546967+AE-MS@users.noreply.github.com> * Update the SDF release yaml (#2308) * Use inline scripts * Exclude _manifest artifact from version * Whitespace * Removed importing from the entire public index.ts file (#2307) * cleaned up some imports in the private folder --------- Co-authored-by: Trevor Harris * Updated and e2e tests data in teams-js (#2311) * Add production pipeline YAML (#2310) * add prod pipeline * restrict branches for prod pipeline * add DDL pipeline * update routes to properly describe the new page * Revert "update routes to properly describe the new page" This reverts commit 7d8a4211b24171d4a1f0fe78e698340cc8099c24. * Revert "Revert "update routes to properly describe the new page"" This reverts commit 53cf9835527a57897af5925bcceea45f34555207. --------- Co-authored-by: Trevor Harris Co-authored-by: Vikram Thanigaivelan <116702367+vikramtha@users.noreply.github.com> Co-authored-by: Kerryn Frampton <56459261+kerrynf@users.noreply.github.com> Co-authored-by: sumathin Co-authored-by: sumathin Co-authored-by: noahdarveau-MSFT <109628470+noahdarveau-MSFT@users.noreply.github.com> Co-authored-by: Jeff Klouda <93734408+jekloudaMSFT@users.noreply.github.com> Co-authored-by: jadahiya-MSFT <95651173+jadahiya-MSFT@users.noreply.github.com> Co-authored-by: Shreyas <98348000+shrshindeMSFT@users.noreply.github.com> Co-authored-by: ndangudubiyyam <90732984+ndangudubiyyam@users.noreply.github.com> Co-authored-by: Lakhveer Kaur Co-authored-by: Erin Co-authored-by: AE ( ͡ಠ ʖ̯ ͡ಠ) <36546967+AE-MS@users.noreply.github.com> Co-authored-by: KangxuanYe <107154810+KangxuanYe@users.noreply.github.com> Co-authored-by: Stephen Houston <5623311+cloudtx@users.noreply.github.com> Co-authored-by: sthousto Co-authored-by: Ella-ly <85649572+Ella-ly@users.noreply.github.com> --- apps/teams-test-app/package.json | 3 +- apps/teams-test-app/src/App.tsx | 147 +++--------------- .../teams-test-app/src/components/AppAPIs.tsx | 11 +- apps/teams-test-app/src/pages/SecondRoute.tsx | 10 ++ apps/teams-test-app/src/pages/TestApp.tsx | 136 ++++++++++++++++ apps/teams-test-app/webpack.common.js | 1 + pnpm-lock.yaml | 34 ++++ tools/releases/ddl-release.yml | 84 +++++----- 8 files changed, 253 insertions(+), 173 deletions(-) create mode 100644 apps/teams-test-app/src/pages/SecondRoute.tsx create mode 100644 apps/teams-test-app/src/pages/TestApp.tsx diff --git a/apps/teams-test-app/package.json b/apps/teams-test-app/package.json index 7e1bf7dec9..82b8c038f8 100644 --- a/apps/teams-test-app/package.json +++ b/apps/teams-test-app/package.json @@ -21,7 +21,8 @@ }, "dependencies": { "react": "^17.0.1", - "react-dom": "^17.0.1" + "react-dom": "^17.0.1", + "react-router-dom": "^6.21.3" }, "devDependencies": { "@microsoft/teams-js": "workspace:*" diff --git a/apps/teams-test-app/src/App.tsx b/apps/teams-test-app/src/App.tsx index 7fe9665b8d..4a2f44ebde 100644 --- a/apps/teams-test-app/src/App.tsx +++ b/apps/teams-test-app/src/App.tsx @@ -1,70 +1,12 @@ import './App.css'; -import { app, appInitialization, IAppWindow, initialize } from '@microsoft/teams-js'; +import { app, appInitialization, initialize } from '@microsoft/teams-js'; import React, { ReactElement } from 'react'; +import { BrowserRouter, Route, Routes } from 'react-router-dom'; -import AppAPIs from './components/AppAPIs'; -import AppEntityAPIs from './components/AppEntityAPIs'; -import AppInitializationAPIs from './components/AppInitialization'; -import AppInstallDialogAPIs from './components/AppInstallDialog'; -import AuthenticationAPIs from './components/AuthenticationAPIs'; -import BarCodeAPIs from './components/BarCodeAPIs'; -import CalendarAPIs from './components/CalendarAPIs'; -import CallAPIs from './components/CallAPIs'; -import ClipboardAPIs from './components/Clipboard'; -import CustomAPIs from './components/Custom'; -import DialogAPIs from './components/DialogAPIs'; -import DialogCardAPIs from './components/DialogCardAPIs'; -import DialogCardBotAPIs from './components/DialogCardBotAPIs'; -import DialogUpdateAPIs from './components/DialogUpdateAPIs'; -import DialogUrlAPIs from './components/DialogUrlAPIs'; -import DialogUrlBotAPIs from './components/DialogUrlBotAPIs'; -import DialogUrlParentCommunicationAPIs from './components/DialogUrlParentCommunicationAPIs'; -import GeoLocationAPIs from './components/GeoLocationAPIs'; -import Links from './components/Links'; -import LocationAPIs from './components/LocationAPIs'; -import LogAPIs from './components/LogsAPIs'; -import MailAPIs from './components/MailAPIs'; -import MarketplaceAPIs from './components/MarketplaceAPIs'; -import MediaAPIs from './components/MediaAPIs'; -import MeetingAPIs from './components/MeetingAPIs'; -import MenusAPIs from './components/MenusAPIs'; -import NestedAppAuthAPIs from './components/NestedAppAuthAPIs'; -import OtherAppStateChangedAPIs from './components/OtherAppStateChangeAPIs'; -import PagesAPIs from './components/PagesAPIs'; -import PagesAppButtonAPIs from './components/PagesAppButtonAPIs'; -import PagesBackStackAPIs from './components/PagesBackStackAPIs'; -import PagesConfigAPIs from './components/PagesConfigAPIs'; -import PagesCurrentAppAPIs from './components/PagesCurrentAppAPIs'; -import PagesTabsAPIs from './components/PagesTabsAPIs'; -import PeopleAPIs from './components/PeopleAPIs'; -import ChatAPIs from './components/privateApis/ChatAPIs'; -import ExternalAppAuthenticationAPIs from './components/privateApis/ExternalAppAuthenticationAPIs'; -import ExternalAppCardActionsAPIs from './components/privateApis/ExternalAppCardActionsAPIs'; -import ExternalAppCommandsAPIs from './components/privateApis/ExternalAppCommandsAPIs'; -import FilesAPIs from './components/privateApis/FilesAPIs'; -import FullTrustAPIs from './components/privateApis/FullTrustAPIs'; -import MeetingRoomAPIs from './components/privateApis/MeetingRoomAPIs'; -import MessageChannelAPIs from './components/privateApis/MessageChannelAPIs'; -import MonetizationAPIs from './components/privateApis/MonetizationAPIs'; -import NotificationAPIs from './components/privateApis/NotificationAPIs'; -import PrivateAPIs from './components/privateApis/PrivateAPIs'; -import TeamsAPIs from './components/privateApis/TeamsAPIs'; -import VideoExAPIs from './components/privateApis/VideoEffectsExAPIs'; -import ProfileAPIs from './components/ProfileAPIs'; -import RemoteCameraAPIs from './components/RemoteCameraAPIs'; -import SearchAPIs from './components/SearchAPIs'; -import SecondaryBrowserAPIs from './components/SecondaryBrowserAPIs'; -import SharingAPIs from './components/SharingAPIs'; -import StageViewAPIs from './components/StageViewAPIs'; -import TeamsCoreAPIs from './components/TeamsCoreAPIs'; -import ThirdPartyCloudStorageAPIs from './components/ThirdPartyCloudStorageAPIs'; -import CookieAccessComponent from './components/ThirdPatryCookies'; import { isTestBackCompat } from './components/utils/isTestBackCompat'; -import Version from './components/Version'; -import VideoAPIs from './components/VideoEffectsApis'; -import VisualMediaAPIs from './components/VisualMediaAPIs'; -import WebStorageAPIs from './components/WebStorageAPIs'; +import { SecondRoute } from './pages/SecondRoute'; +import { TestApp } from './pages/TestApp'; const urlParams = new URLSearchParams(window.location.search); @@ -138,74 +80,23 @@ export const generateRegistrationMsg = (changeCause: string): string => { return `Registration attempt has been initiated. If successful, this message will change when ${changeCause}.`; }; +// button to route to the second route +export const SecondRouteButton = (): ReactElement => ( + + + +); + const App = (): ReactElement => { - const dialogWindowRef = React.useRef(null); return ( -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
+ <> + + + } /> + } /> + + + ); }; diff --git a/apps/teams-test-app/src/components/AppAPIs.tsx b/apps/teams-test-app/src/components/AppAPIs.tsx index 0ebacb7ea0..e92dc0ea21 100644 --- a/apps/teams-test-app/src/components/AppAPIs.tsx +++ b/apps/teams-test-app/src/components/AppAPIs.tsx @@ -7,6 +7,7 @@ import { ResumeContext, } from '@microsoft/teams-js'; import React, { ReactElement } from 'react'; +import { useNavigate } from 'react-router-dom'; import { ApiWithoutInput, ApiWithTextInput } from './utils'; import { ModuleWrapper } from './utils/ModuleWrapper'; @@ -79,19 +80,25 @@ const RegisterOnThemeChangeHandler = (): ReactElement => }, }); -const RegisterOnResumeHandler = (): React.ReactElement => - ApiWithoutInput({ +const RegisterOnResumeHandler = (): React.ReactElement => { + const navigate = useNavigate(); + return ApiWithoutInput({ name: 'RegisterOnResumeHandler', title: 'Register On Resume Handler', onClick: async (setResult) => { app.lifecycle.registerOnResumeHandler((context: ResumeContext): void => { setResult('successfully called with context:' + JSON.stringify(context)); + // get the route from the context + const route = new URL(context.contentUrl); + // navigate to the correct path based on URL + navigate(route.pathname); app.notifySuccess(); }); return 'registered'; }, }); +}; const RegisterBeforeSuspendOrTerminateHandler = (): React.ReactElement => ApiWithoutInput({ diff --git a/apps/teams-test-app/src/pages/SecondRoute.tsx b/apps/teams-test-app/src/pages/SecondRoute.tsx new file mode 100644 index 0000000000..208eb220c3 --- /dev/null +++ b/apps/teams-test-app/src/pages/SecondRoute.tsx @@ -0,0 +1,10 @@ +import React, { ReactElement } from 'react'; + +import AppAPIs from '../components/AppAPIs'; + +export const SecondRoute = (): ReactElement => ( +
+ This is an additional route for testing purposes. + +
+); diff --git a/apps/teams-test-app/src/pages/TestApp.tsx b/apps/teams-test-app/src/pages/TestApp.tsx new file mode 100644 index 0000000000..78ef804a75 --- /dev/null +++ b/apps/teams-test-app/src/pages/TestApp.tsx @@ -0,0 +1,136 @@ +import { IAppWindow } from '@microsoft/teams-js'; +import React from 'react'; + +import AppAPIs from '../components/AppAPIs'; +import AppEntityAPIs from '../components/AppEntityAPIs'; +import AppInitializationAPIs from '../components/AppInitialization'; +import AppInstallDialogAPIs from '../components/AppInstallDialog'; +import AuthenticationAPIs from '../components/AuthenticationAPIs'; +import BarCodeAPIs from '../components/BarCodeAPIs'; +import CalendarAPIs from '../components/CalendarAPIs'; +import CallAPIs from '../components/CallAPIs'; +import ClipboardAPIs from '../components/Clipboard'; +import CustomAPIs from '../components/Custom'; +import DialogAPIs from '../components/DialogAPIs'; +import DialogCardAPIs from '../components/DialogCardAPIs'; +import DialogCardBotAPIs from '../components/DialogCardBotAPIs'; +import DialogUpdateAPIs from '../components/DialogUpdateAPIs'; +import DialogUrlAPIs from '../components/DialogUrlAPIs'; +import DialogUrlBotAPIs from '../components/DialogUrlBotAPIs'; +import DialogUrlParentCommunicationAPIs from '../components/DialogUrlParentCommunicationAPIs'; +import GeoLocationAPIs from '../components/GeoLocationAPIs'; +import Links from '../components/Links'; +import LocationAPIs from '../components/LocationAPIs'; +import LogAPIs from '../components/LogsAPIs'; +import MailAPIs from '../components/MailAPIs'; +import MarketplaceAPIs from '../components/MarketplaceAPIs'; +import MediaAPIs from '../components/MediaAPIs'; +import MeetingAPIs from '../components/MeetingAPIs'; +import MenusAPIs from '../components/MenusAPIs'; +import NestedAppAuthAPIs from '../components/NestedAppAuthAPIs'; +import OtherAppStateChangedAPIs from '../components/OtherAppStateChangeAPIs'; +import PagesAPIs from '../components/PagesAPIs'; +import PagesAppButtonAPIs from '../components/PagesAppButtonAPIs'; +import PagesBackStackAPIs from '../components/PagesBackStackAPIs'; +import PagesConfigAPIs from '../components/PagesConfigAPIs'; +import PagesCurrentAppAPIs from '../components/PagesCurrentAppAPIs'; +import PagesTabsAPIs from '../components/PagesTabsAPIs'; +import PeopleAPIs from '../components/PeopleAPIs'; +import ChatAPIs from '../components/privateApis/ChatAPIs'; +import ExternalAppAuthenticationAPIs from '../components/privateApis/ExternalAppAuthenticationAPIs'; +import ExternalAppCardActionsAPIs from '../components/privateApis/ExternalAppCardActionsAPIs'; +import ExternalAppCommandsAPIs from '../components/privateApis/ExternalAppCommandsAPIs'; +import FilesAPIs from '../components/privateApis/FilesAPIs'; +import FullTrustAPIs from '../components/privateApis/FullTrustAPIs'; +import MeetingRoomAPIs from '../components/privateApis/MeetingRoomAPIs'; +import MessageChannelAPIs from '../components/privateApis/MessageChannelAPIs'; +import MonetizationAPIs from '../components/privateApis/MonetizationAPIs'; +import NotificationAPIs from '../components/privateApis/NotificationAPIs'; +import PrivateAPIs from '../components/privateApis/PrivateAPIs'; +import TeamsAPIs from '../components/privateApis/TeamsAPIs'; +import VideoExAPIs from '../components/privateApis/VideoEffectsExAPIs'; +import ProfileAPIs from '../components/ProfileAPIs'; +import RemoteCameraAPIs from '../components/RemoteCameraAPIs'; +import SearchAPIs from '../components/SearchAPIs'; +import SecondaryBrowserAPIs from '../components/SecondaryBrowserAPIs'; +import SharingAPIs from '../components/SharingAPIs'; +import StageViewAPIs from '../components/StageViewAPIs'; +import TeamsCoreAPIs from '../components/TeamsCoreAPIs'; +import ThirdPartyCloudStorageAPIs from '../components/ThirdPartyCloudStorageAPIs'; +import CookieAccessComponent from '../components/ThirdPatryCookies'; +import Version from '../components/Version'; +import VideoAPIs from '../components/VideoEffectsApis'; +import VisualMediaAPIs from '../components/VisualMediaAPIs'; +import WebStorageAPIs from '../components/WebStorageAPIs'; + +export const TestApp: React.FC = () => { + const dialogWindowRef = React.useRef(null); + + return ( + <> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + ); +}; diff --git a/apps/teams-test-app/webpack.common.js b/apps/teams-test-app/webpack.common.js index f081afb16f..5298e57a05 100644 --- a/apps/teams-test-app/webpack.common.js +++ b/apps/teams-test-app/webpack.common.js @@ -33,6 +33,7 @@ module.exports = { extensions: ['.tsx', '.ts', '.js'], }, devServer: { + historyApiFallback: true, // enables react router static: { directory: path.join(__dirname, 'build'), publicPath: '/', diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b82dd7b77d..02a5e03c16 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -321,6 +321,9 @@ importers: react-dom: specifier: ^17.0.1 version: 17.0.2(react@17.0.2) + react-router-dom: + specifier: ^6.21.3 + version: 6.23.0(react-dom@17.0.2(react@17.0.2))(react@17.0.2) devDependencies: '@microsoft/teams-js': specifier: workspace:* @@ -2023,6 +2026,10 @@ packages: '@polka/url@1.0.0-next.25': resolution: {integrity: sha512-j7P6Rgr3mmtdkeDGTe0E/aYyWEWVtc5yFXtHCRHs28/jptDEWfaVOc5T7cblqy1XKPPfCxJc/8DwQ5YgLOZOVQ==} + '@remix-run/router@1.16.0': + resolution: {integrity: sha512-Quz1KOffeEf/zwkCBM3kBtH4ZoZ+pT3xIXBG4PPW/XFtDP7EGhtTiC2+gpL9GnR7+Qdet5Oa6cYSvwKYg6kN9Q==} + engines: {node: '>=14.0.0'} + '@sigstore/bundle@1.1.0': resolution: {integrity: sha512-PFutXEy0SmQxYI4texPw3dd2KewuNqv7OuK1ZFtY2fM754yhvG2KdgwIhRnoEE2uHdtdGNQ8s0lb94dW9sELog==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -5809,6 +5816,19 @@ packages: react-is@18.2.0: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} + react-router-dom@6.23.0: + resolution: {integrity: sha512-Q9YaSYvubwgbal2c9DJKfx6hTNoBp3iJDsl+Duva/DwxoJH+OTXkxGpql4iUK2sla/8z4RpjAm6EWx1qUDuopQ==} + engines: {node: '>=14.0.0'} + peerDependencies: + react: '>=16.8' + react-dom: '>=16.8' + + react-router@6.23.0: + resolution: {integrity: sha512-wPMZ8S2TuPadH0sF5irFGjkNLIcRvOSaEe7v+JER8508dyJumm6XZB1u5kztlX0RVq6AzRVndzqcUh6sFIauzA==} + engines: {node: '>=14.0.0'} + peerDependencies: + react: '>=16.8' + react-transition-group@4.4.5: resolution: {integrity: sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==} peerDependencies: @@ -9633,6 +9653,8 @@ snapshots: '@polka/url@1.0.0-next.25': {} + '@remix-run/router@1.16.0': {} + '@sigstore/bundle@1.1.0': dependencies: '@sigstore/protobuf-specs': 0.2.1 @@ -14228,6 +14250,18 @@ snapshots: react-is@18.2.0: {} + react-router-dom@6.23.0(react-dom@17.0.2(react@17.0.2))(react@17.0.2): + dependencies: + '@remix-run/router': 1.16.0 + react: 17.0.2 + react-dom: 17.0.2(react@17.0.2) + react-router: 6.23.0(react@17.0.2) + + react-router@6.23.0(react@17.0.2): + dependencies: + '@remix-run/router': 1.16.0 + react: 17.0.2 + react-transition-group@4.4.5(react-dom@17.0.2(react@17.0.2))(react@17.0.2): dependencies: '@babel/runtime': 7.24.4 diff --git a/tools/releases/ddl-release.yml b/tools/releases/ddl-release.yml index af2dfe6dc2..c866953cbd 100644 --- a/tools/releases/ddl-release.yml +++ b/tools/releases/ddl-release.yml @@ -1,14 +1,14 @@ trigger: none resources: repositories: - - repository: GovernedTemplates - type: git - name: OneBranch.Pipelines/GovernedTemplates - ref: refs/heads/main + - repository: GovernedTemplates + type: git + name: OneBranch.Pipelines/GovernedTemplates + ref: refs/heads/main pipelines: - - pipeline: microsoft-teams-library-js-pipeline - source: 'M365 Platform/App SDK/OfficeDev.microsoft-teams-library-js' - project: ISS + - pipeline: microsoft-teams-library-js-pipeline + source: 'M365 Platform/App SDK/OfficeDev.microsoft-teams-library-js' + project: ISS extends: template: v2/Microsoft.Official.yml@GovernedTemplates parameters: @@ -18,38 +18,38 @@ extends: serviceTreeId: $(serviceTreeId) serviceGroupName: Platform stages: - - stage: Prod_Lockbox_Approval_Deployment - displayName: Lockbox Approval/Deployment - dependsOn: [] - variables: - stage_type: deployment - azure_subscription_ids: $(subscriptionId) - jobs: - - job: Agent_job - condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')) - pool: - type: release - steps: - - download: microsoft-teams-library-js-pipeline - - task: prepare-deployment@1 - displayName: - inputs: - taskType: credentialFetchTaskAzureRM - armserviceconnection: $(serviceConnectionId) - subscriptionid: $(subscriptionId) - - task: NodeTool@0 - displayName: Use Node 18.x - inputs: - versionSpec: 18.x - - task: M365CdnAssetsUpload@3 - displayName: Push valid domains to M365 1CDN (Prod) - inputs: - SourcePath: $(PIPELINE.WORKSPACE)/microsoft-teams-library-js-pipeline/validDomains - ConnectedServiceNameARM: $(serviceConnectionId) - ContainerName: teams-js - AdditionalArgumentsForBlobCopy: --log-level=INFO --recursive --overwrite=true - - task: AssetRetention@3 - displayName: ARtifact Retention Orchestrator Workflow (ARROW) - inputs: - ArrowServiceConnection: $(arrowServiceConnectionId) - IsShipped: true + - stage: Prod_Lockbox_Approval_Deployment + displayName: Lockbox Approval/Deployment + dependsOn: [] + variables: + stage_type: deployment + azure_subscription_ids: $(subscriptionId) + jobs: + - job: Agent_job + condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')) + pool: + type: release + steps: + - download: microsoft-teams-library-js-pipeline + - task: prepare-deployment@1 + displayName: + inputs: + taskType: credentialFetchTaskAzureRM + armserviceconnection: $(serviceConnectionId) + subscriptionid: $(subscriptionId) + - task: NodeTool@0 + displayName: Use Node 18.x + inputs: + versionSpec: 18.x + - task: M365CdnAssetsUpload@3 + displayName: Push valid domains to M365 1CDN (Prod) + inputs: + SourcePath: $(PIPELINE.WORKSPACE)/microsoft-teams-library-js-pipeline/validDomains + ConnectedServiceNameARM: $(serviceConnectionId) + ContainerName: teams-js + AdditionalArgumentsForBlobCopy: --log-level=INFO --recursive --overwrite=true + - task: AssetRetention@3 + displayName: ARtifact Retention Orchestrator Workflow (ARROW) + inputs: + ArrowServiceConnection: $(arrowServiceConnectionId) + IsShipped: true