From 941ab45313d7d64a9aee6dc8f3272f097bc7c628 Mon Sep 17 00:00:00 2001 From: vikramtha Date: Wed, 22 May 2024 16:37:06 -0700 Subject: [PATCH 01/16] Adding internal App ID param in getContext --- packages/teams-js/src/public/app.ts | 6 ++++++ packages/teams-js/src/public/interfaces.ts | 8 ++++++++ packages/teams-js/test/public/app.spec.ts | 4 ++++ packages/teams-js/test/public/publicAPIs.spec.ts | 1 + 4 files changed, 19 insertions(+) diff --git a/packages/teams-js/src/public/app.ts b/packages/teams-js/src/public/app.ts index 0b32527806..12e05afaca 100644 --- a/packages/teams-js/src/public/app.ts +++ b/packages/teams-js/src/public/app.ts @@ -354,6 +354,11 @@ export namespace app { * ID for the current visible app which is different for across cached sessions. Used for correlating telemetry data. */ appLaunchId?: string; + + /** + * Internal app id that is used by Hubs to distinguish between different apps sideloaded or in store + */ + intAppId?: string; } /** @@ -1007,6 +1012,7 @@ function transformLegacyContextToAppContext(legacyContext: LegacyContext): app.C ringId: legacyContext.ringId, }, appLaunchId: legacyContext.appLaunchId, + intAppId: legacyContext.intAppId, }, page: { id: legacyContext.entityId, diff --git a/packages/teams-js/src/public/interfaces.ts b/packages/teams-js/src/public/interfaces.ts index faf4956f69..dc8d46c8c4 100644 --- a/packages/teams-js/src/public/interfaces.ts +++ b/packages/teams-js/src/public/interfaces.ts @@ -757,6 +757,14 @@ export interface Context { * They help pre-fill the dialog with necessary information (`dialogParameters`) along with other details. */ dialogParameters?: Record; + + /** + * @deprecated + * As of 2.0.0, please use {link app.Context.intAppId} instead + * + * Internal app id that is used by Hubs to distinguish between different apps sideloaded or in store + */ + intAppId?: string; } /** Represents the parameters used to share a deep link. */ diff --git a/packages/teams-js/test/public/app.spec.ts b/packages/teams-js/test/public/app.spec.ts index 757a50cdb6..c17cdfc54a 100644 --- a/packages/teams-js/test/public/app.spec.ts +++ b/packages/teams-js/test/public/app.spec.ts @@ -558,6 +558,7 @@ describe('Testing app capability', () => { appLaunchId: 'appLaunchId', userDisplayName: 'someTestUser', teamSiteId: 'someSiteId', + intAppId: 'someIntAppId', }; const expectedContext: app.Context = { @@ -571,6 +572,7 @@ describe('Testing app capability', () => { userClickTime: 2222, userFileOpenPreference: FileOpenPreference.Inline, appLaunchId: 'appLaunchId', + intAppId: 'someintAppId', host: { name: HostName.orange, clientType: HostClientType.web, @@ -1426,6 +1428,7 @@ describe('Testing app capability', () => { appLaunchId: 'appLaunchId', userDisplayName: 'someTestUser', teamSiteId: 'someSiteId', + intAppId: 'someintAppId', }; const expectedContext: app.Context = { @@ -1445,6 +1448,7 @@ describe('Testing app capability', () => { ringId: 'someRingId', }, appLaunchId: 'appLaunchId', + intAppId: 'someintAppId', }, page: { id: 'someEntityId', diff --git a/packages/teams-js/test/public/publicAPIs.spec.ts b/packages/teams-js/test/public/publicAPIs.spec.ts index 8775f0764a..8eede063d4 100644 --- a/packages/teams-js/test/public/publicAPIs.spec.ts +++ b/packages/teams-js/test/public/publicAPIs.spec.ts @@ -348,6 +348,7 @@ describe('MicrosoftTeams-publicAPIs', () => { appSessionId: 'appSessionId', appLaunchId: 'appLaunchId', meetingId: 'dummyMeetingId', + intAppId: 'dummyIntAppId', }; getContext((context) => { Object.keys(expectedContext).forEach((e) => { From f0934257763687062930be875ca131f71de96747 Mon Sep 17 00:00:00 2001 From: vikramtha Date: Wed, 22 May 2024 16:38:06 -0700 Subject: [PATCH 02/16] changefile --- ...soft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json diff --git a/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json b/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json new file mode 100644 index 0000000000..8657eefd8f --- /dev/null +++ b/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "Added a new parameter to getContext() API called intAppId for Internal App ID", + "packageName": "@microsoft/teams-js", + "email": "vikramtha@microsoft.com", + "dependentChangeType": "patch" +} From d1f4c45598393dc0ba999ec90f5786d909f004ce Mon Sep 17 00:00:00 2001 From: vikramtha Date: Mon, 10 Jun 2024 15:22:26 -0700 Subject: [PATCH 03/16] Updated intAppId to internalAppId and added link --- ...oft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json | 2 +- packages/teams-js/src/public/app.ts | 4 ++-- packages/teams-js/src/public/interfaces.ts | 4 ++-- packages/teams-js/test/public/app.spec.ts | 8 ++++---- packages/teams-js/test/public/publicAPIs.spec.ts | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json b/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json index 8657eefd8f..cc3995ee4c 100644 --- a/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json +++ b/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json @@ -1,6 +1,6 @@ { "type": "minor", - "comment": "Added a new parameter to getContext() API called intAppId for Internal App ID", + "comment": "Added a new parameter to getContext() API called internalAppId for Internal App ID", "packageName": "@microsoft/teams-js", "email": "vikramtha@microsoft.com", "dependentChangeType": "patch" diff --git a/packages/teams-js/src/public/app.ts b/packages/teams-js/src/public/app.ts index 12e05afaca..e901c2382b 100644 --- a/packages/teams-js/src/public/app.ts +++ b/packages/teams-js/src/public/app.ts @@ -358,7 +358,7 @@ export namespace app { /** * Internal app id that is used by Hubs to distinguish between different apps sideloaded or in store */ - intAppId?: string; + internalAppId?: string; } /** @@ -1012,7 +1012,7 @@ function transformLegacyContextToAppContext(legacyContext: LegacyContext): app.C ringId: legacyContext.ringId, }, appLaunchId: legacyContext.appLaunchId, - intAppId: legacyContext.intAppId, + internalAppId: legacyContext.internalAppId, }, page: { id: legacyContext.entityId, diff --git a/packages/teams-js/src/public/interfaces.ts b/packages/teams-js/src/public/interfaces.ts index be9a655149..628ea63dbf 100644 --- a/packages/teams-js/src/public/interfaces.ts +++ b/packages/teams-js/src/public/interfaces.ts @@ -760,11 +760,11 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {link app.Context.intAppId} instead + * As of 2.0.0, please use {@link app.Context.internalAppId} instead * * Internal app id that is used by Hubs to distinguish between different apps sideloaded or in store */ - intAppId?: string; + internalAppId?: string; } /** Represents the parameters used to share a deep link. */ diff --git a/packages/teams-js/test/public/app.spec.ts b/packages/teams-js/test/public/app.spec.ts index c17cdfc54a..60228c12f8 100644 --- a/packages/teams-js/test/public/app.spec.ts +++ b/packages/teams-js/test/public/app.spec.ts @@ -558,7 +558,7 @@ describe('Testing app capability', () => { appLaunchId: 'appLaunchId', userDisplayName: 'someTestUser', teamSiteId: 'someSiteId', - intAppId: 'someIntAppId', + internalAppId: 'someInternalAppId', }; const expectedContext: app.Context = { @@ -572,7 +572,7 @@ describe('Testing app capability', () => { userClickTime: 2222, userFileOpenPreference: FileOpenPreference.Inline, appLaunchId: 'appLaunchId', - intAppId: 'someintAppId', + internalAppId: 'someinternalAppId', host: { name: HostName.orange, clientType: HostClientType.web, @@ -1428,7 +1428,7 @@ describe('Testing app capability', () => { appLaunchId: 'appLaunchId', userDisplayName: 'someTestUser', teamSiteId: 'someSiteId', - intAppId: 'someintAppId', + internalAppId: 'someinternalAppId', }; const expectedContext: app.Context = { @@ -1448,7 +1448,7 @@ describe('Testing app capability', () => { ringId: 'someRingId', }, appLaunchId: 'appLaunchId', - intAppId: 'someintAppId', + internalAppId: 'someinternalAppId', }, page: { id: 'someEntityId', diff --git a/packages/teams-js/test/public/publicAPIs.spec.ts b/packages/teams-js/test/public/publicAPIs.spec.ts index 8eede063d4..cdc7b7f142 100644 --- a/packages/teams-js/test/public/publicAPIs.spec.ts +++ b/packages/teams-js/test/public/publicAPIs.spec.ts @@ -348,7 +348,7 @@ describe('MicrosoftTeams-publicAPIs', () => { appSessionId: 'appSessionId', appLaunchId: 'appLaunchId', meetingId: 'dummyMeetingId', - intAppId: 'dummyIntAppId', + internalAppId: 'dummyInternalAppId', }; getContext((context) => { Object.keys(expectedContext).forEach((e) => { From 4d07b51a06ce7c45f37acb8c31755ae65615f513 Mon Sep 17 00:00:00 2001 From: Trevor Harris Date: Mon, 1 Jul 2024 11:36:06 -0700 Subject: [PATCH 04/16] Update packages/teams-js/src/public/app.ts --- packages/teams-js/src/public/app.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/teams-js/src/public/app.ts b/packages/teams-js/src/public/app.ts index 4dad16b2ce..7c0a9fb37e 100644 --- a/packages/teams-js/src/public/app.ts +++ b/packages/teams-js/src/public/app.ts @@ -356,7 +356,7 @@ export namespace app { appLaunchId?: string; /** - * Internal app id that is used by Hubs to distinguish between different apps sideloaded or in store + * Internal app id that is used by Hosts to distinguish between different apps sideloaded or in store */ internalAppId?: string; } From e4847fd0b4bce3865f4e9fc13cf48ef7198c7dca Mon Sep 17 00:00:00 2001 From: vikramtha Date: Tue, 2 Jul 2024 13:49:53 -0700 Subject: [PATCH 05/16] Updated to remove changes --- ...osoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json | 2 +- packages/teams-js/src/public/app.ts | 6 ------ packages/teams-js/test/public/app.spec.ts | 4 ---- packages/teams-js/test/public/publicAPIs.spec.ts | 1 - 4 files changed, 1 insertion(+), 12 deletions(-) diff --git a/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json b/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json index cc3995ee4c..56cf7fb25a 100644 --- a/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json +++ b/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json @@ -1,6 +1,6 @@ { "type": "minor", - "comment": "Added a new parameter to getContext() API called internalAppId for Internal App ID", + "comment": "Added a new parameter to getContext() API called appId for developers to access their current App ID", "packageName": "@microsoft/teams-js", "email": "vikramtha@microsoft.com", "dependentChangeType": "patch" diff --git a/packages/teams-js/src/public/app.ts b/packages/teams-js/src/public/app.ts index 7c0a9fb37e..8efd2fa1e9 100644 --- a/packages/teams-js/src/public/app.ts +++ b/packages/teams-js/src/public/app.ts @@ -354,11 +354,6 @@ export namespace app { * ID for the current visible app which is different for across cached sessions. Used for correlating telemetry data. */ appLaunchId?: string; - - /** - * Internal app id that is used by Hosts to distinguish between different apps sideloaded or in store - */ - internalAppId?: string; } /** @@ -1012,7 +1007,6 @@ function transformLegacyContextToAppContext(legacyContext: LegacyContext): app.C ringId: legacyContext.ringId, }, appLaunchId: legacyContext.appLaunchId, - internalAppId: legacyContext.internalAppId, }, page: { id: legacyContext.entityId, diff --git a/packages/teams-js/test/public/app.spec.ts b/packages/teams-js/test/public/app.spec.ts index b9fb934201..27fc99e6dc 100644 --- a/packages/teams-js/test/public/app.spec.ts +++ b/packages/teams-js/test/public/app.spec.ts @@ -563,7 +563,6 @@ describe('Testing app capability', () => { appLaunchId: 'appLaunchId', userDisplayName: 'someTestUser', teamSiteId: 'someSiteId', - internalAppId: 'someInternalAppId', }; const expectedContext: app.Context = { @@ -577,7 +576,6 @@ describe('Testing app capability', () => { userClickTime: 2222, userFileOpenPreference: FileOpenPreference.Inline, appLaunchId: 'appLaunchId', - internalAppId: 'someinternalAppId', host: { name: HostName.orange, clientType: HostClientType.web, @@ -1432,7 +1430,6 @@ describe('Testing app capability', () => { appLaunchId: 'appLaunchId', userDisplayName: 'someTestUser', teamSiteId: 'someSiteId', - internalAppId: 'someinternalAppId', }; const expectedContext: app.Context = { @@ -1452,7 +1449,6 @@ describe('Testing app capability', () => { ringId: 'someRingId', }, appLaunchId: 'appLaunchId', - internalAppId: 'someinternalAppId', }, page: { id: 'someEntityId', diff --git a/packages/teams-js/test/public/publicAPIs.spec.ts b/packages/teams-js/test/public/publicAPIs.spec.ts index 884036b1de..e9fc3a13e6 100644 --- a/packages/teams-js/test/public/publicAPIs.spec.ts +++ b/packages/teams-js/test/public/publicAPIs.spec.ts @@ -348,7 +348,6 @@ describe('MicrosoftTeams-publicAPIs', () => { appSessionId: 'appSessionId', appLaunchId: 'appLaunchId', meetingId: 'dummyMeetingId', - internalAppId: 'dummyInternalAppId', }; getContext((context) => { Object.keys(expectedContext).forEach((e) => { From e9d8e5d4635428ecb7ced90d7536e0a578730cbd Mon Sep 17 00:00:00 2001 From: vikramtha Date: Tue, 2 Jul 2024 13:50:05 -0700 Subject: [PATCH 06/16] pt2 --- packages/teams-js/src/public/interfaces.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/teams-js/src/public/interfaces.ts b/packages/teams-js/src/public/interfaces.ts index fd647f7cba..3092418aab 100644 --- a/packages/teams-js/src/public/interfaces.ts +++ b/packages/teams-js/src/public/interfaces.ts @@ -757,14 +757,6 @@ export interface Context { * They help pre-fill the dialog with necessary information (`dialogParameters`) along with other details. */ dialogParameters?: Record; - - /** - * @deprecated - * As of 2.0.0, please use {@link app.Context.internalAppId} instead - * - * Internal app id that is used by Hubs to distinguish between different apps sideloaded or in store - */ - internalAppId?: string; } /** Represents the parameters used to share a deep link. */ From 008d98895afdc7bd34a2f497bd096df40a5fd116 Mon Sep 17 00:00:00 2001 From: vikramtha Date: Tue, 2 Jul 2024 14:05:06 -0700 Subject: [PATCH 07/16] This reverts commit e4847fd0b4bce3865f4e9fc13cf48ef7198c7dca. sh: line 1: :q: command not found --- ...osoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json | 2 +- packages/teams-js/src/public/app.ts | 6 ++++++ packages/teams-js/test/public/app.spec.ts | 4 ++++ packages/teams-js/test/public/publicAPIs.spec.ts | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json b/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json index 56cf7fb25a..cc3995ee4c 100644 --- a/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json +++ b/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json @@ -1,6 +1,6 @@ { "type": "minor", - "comment": "Added a new parameter to getContext() API called appId for developers to access their current App ID", + "comment": "Added a new parameter to getContext() API called internalAppId for Internal App ID", "packageName": "@microsoft/teams-js", "email": "vikramtha@microsoft.com", "dependentChangeType": "patch" diff --git a/packages/teams-js/src/public/app.ts b/packages/teams-js/src/public/app.ts index 8efd2fa1e9..7c0a9fb37e 100644 --- a/packages/teams-js/src/public/app.ts +++ b/packages/teams-js/src/public/app.ts @@ -354,6 +354,11 @@ export namespace app { * ID for the current visible app which is different for across cached sessions. Used for correlating telemetry data. */ appLaunchId?: string; + + /** + * Internal app id that is used by Hosts to distinguish between different apps sideloaded or in store + */ + internalAppId?: string; } /** @@ -1007,6 +1012,7 @@ function transformLegacyContextToAppContext(legacyContext: LegacyContext): app.C ringId: legacyContext.ringId, }, appLaunchId: legacyContext.appLaunchId, + internalAppId: legacyContext.internalAppId, }, page: { id: legacyContext.entityId, diff --git a/packages/teams-js/test/public/app.spec.ts b/packages/teams-js/test/public/app.spec.ts index 27fc99e6dc..b9fb934201 100644 --- a/packages/teams-js/test/public/app.spec.ts +++ b/packages/teams-js/test/public/app.spec.ts @@ -563,6 +563,7 @@ describe('Testing app capability', () => { appLaunchId: 'appLaunchId', userDisplayName: 'someTestUser', teamSiteId: 'someSiteId', + internalAppId: 'someInternalAppId', }; const expectedContext: app.Context = { @@ -576,6 +577,7 @@ describe('Testing app capability', () => { userClickTime: 2222, userFileOpenPreference: FileOpenPreference.Inline, appLaunchId: 'appLaunchId', + internalAppId: 'someinternalAppId', host: { name: HostName.orange, clientType: HostClientType.web, @@ -1430,6 +1432,7 @@ describe('Testing app capability', () => { appLaunchId: 'appLaunchId', userDisplayName: 'someTestUser', teamSiteId: 'someSiteId', + internalAppId: 'someinternalAppId', }; const expectedContext: app.Context = { @@ -1449,6 +1452,7 @@ describe('Testing app capability', () => { ringId: 'someRingId', }, appLaunchId: 'appLaunchId', + internalAppId: 'someinternalAppId', }, page: { id: 'someEntityId', diff --git a/packages/teams-js/test/public/publicAPIs.spec.ts b/packages/teams-js/test/public/publicAPIs.spec.ts index e9fc3a13e6..884036b1de 100644 --- a/packages/teams-js/test/public/publicAPIs.spec.ts +++ b/packages/teams-js/test/public/publicAPIs.spec.ts @@ -348,6 +348,7 @@ describe('MicrosoftTeams-publicAPIs', () => { appSessionId: 'appSessionId', appLaunchId: 'appLaunchId', meetingId: 'dummyMeetingId', + internalAppId: 'dummyInternalAppId', }; getContext((context) => { Object.keys(expectedContext).forEach((e) => { From 2fd2a53f0e9d4027ae2d946abb3eeca94b5db0cc Mon Sep 17 00:00:00 2001 From: vikramtha Date: Tue, 2 Jul 2024 14:26:39 -0700 Subject: [PATCH 08/16] update back to the inital --- ...oft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json | 2 +- packages/teams-js/src/public/interfaces.ts | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json b/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json index cc3995ee4c..9537ac283b 100644 --- a/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json +++ b/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json @@ -1,6 +1,6 @@ { "type": "minor", - "comment": "Added a new parameter to getContext() API called internalAppId for Internal App ID", + "comment": "Added a new parameter to getContext() API called AppId for Internal App ID", "packageName": "@microsoft/teams-js", "email": "vikramtha@microsoft.com", "dependentChangeType": "patch" diff --git a/packages/teams-js/src/public/interfaces.ts b/packages/teams-js/src/public/interfaces.ts index 3092418aab..fd647f7cba 100644 --- a/packages/teams-js/src/public/interfaces.ts +++ b/packages/teams-js/src/public/interfaces.ts @@ -757,6 +757,14 @@ export interface Context { * They help pre-fill the dialog with necessary information (`dialogParameters`) along with other details. */ dialogParameters?: Record; + + /** + * @deprecated + * As of 2.0.0, please use {@link app.Context.internalAppId} instead + * + * Internal app id that is used by Hubs to distinguish between different apps sideloaded or in store + */ + internalAppId?: string; } /** Represents the parameters used to share a deep link. */ From 27ac101fa254f20ae291f5c3541c491b52014a8b Mon Sep 17 00:00:00 2001 From: vikramtha Date: Tue, 2 Jul 2024 15:41:49 -0700 Subject: [PATCH 09/16] Updated entire PR to match the one in the hubSDK where now the host is not passing the appId and name change from internalAppId to appId --- ...oft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json | 2 +- packages/teams-js/src/public/app.ts | 6 +++--- packages/teams-js/src/public/interfaces.ts | 6 +++--- packages/teams-js/test/public/app.spec.ts | 8 ++++---- packages/teams-js/test/public/publicAPIs.spec.ts | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json b/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json index 9537ac283b..1f69f21045 100644 --- a/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json +++ b/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json @@ -1,6 +1,6 @@ { "type": "minor", - "comment": "Added a new parameter to getContext() API called AppId for Internal App ID", + "comment": "Added a new parameter to `getContext()` API called `appId` for App ID used in deeplinks and by hosts to identify apps", "packageName": "@microsoft/teams-js", "email": "vikramtha@microsoft.com", "dependentChangeType": "patch" diff --git a/packages/teams-js/src/public/app.ts b/packages/teams-js/src/public/app.ts index 7c0a9fb37e..47f33d23cd 100644 --- a/packages/teams-js/src/public/app.ts +++ b/packages/teams-js/src/public/app.ts @@ -356,9 +356,9 @@ export namespace app { appLaunchId?: string; /** - * Internal app id that is used by Hosts to distinguish between different apps sideloaded or in store + * App id that is used by Hosts to distinguish between different apps sideloaded or in store */ - internalAppId?: string; + appId?: string; } /** @@ -1012,7 +1012,7 @@ function transformLegacyContextToAppContext(legacyContext: LegacyContext): app.C ringId: legacyContext.ringId, }, appLaunchId: legacyContext.appLaunchId, - internalAppId: legacyContext.internalAppId, + appId: legacyContext.appId, }, page: { id: legacyContext.entityId, diff --git a/packages/teams-js/src/public/interfaces.ts b/packages/teams-js/src/public/interfaces.ts index fd647f7cba..d53f2762e0 100644 --- a/packages/teams-js/src/public/interfaces.ts +++ b/packages/teams-js/src/public/interfaces.ts @@ -760,11 +760,11 @@ export interface Context { /** * @deprecated - * As of 2.0.0, please use {@link app.Context.internalAppId} instead + * As of 2.0.0, please use {@link app.AppInfo.appId | app.Context.app.appId} instead * - * Internal app id that is used by Hubs to distinguish between different apps sideloaded or in store + * App id that is used by Hosts to distinguish between different apps sideloaded or in store */ - internalAppId?: string; + appId?: string; } /** Represents the parameters used to share a deep link. */ diff --git a/packages/teams-js/test/public/app.spec.ts b/packages/teams-js/test/public/app.spec.ts index b9fb934201..5134ccb003 100644 --- a/packages/teams-js/test/public/app.spec.ts +++ b/packages/teams-js/test/public/app.spec.ts @@ -563,7 +563,7 @@ describe('Testing app capability', () => { appLaunchId: 'appLaunchId', userDisplayName: 'someTestUser', teamSiteId: 'someSiteId', - internalAppId: 'someInternalAppId', + appId: 'someAppId', }; const expectedContext: app.Context = { @@ -577,7 +577,7 @@ describe('Testing app capability', () => { userClickTime: 2222, userFileOpenPreference: FileOpenPreference.Inline, appLaunchId: 'appLaunchId', - internalAppId: 'someinternalAppId', + appId: 'someAppId', host: { name: HostName.orange, clientType: HostClientType.web, @@ -1432,7 +1432,7 @@ describe('Testing app capability', () => { appLaunchId: 'appLaunchId', userDisplayName: 'someTestUser', teamSiteId: 'someSiteId', - internalAppId: 'someinternalAppId', + appId: 'appId', }; const expectedContext: app.Context = { @@ -1452,7 +1452,7 @@ describe('Testing app capability', () => { ringId: 'someRingId', }, appLaunchId: 'appLaunchId', - internalAppId: 'someinternalAppId', + appId: 'someAppId', }, page: { id: 'someEntityId', diff --git a/packages/teams-js/test/public/publicAPIs.spec.ts b/packages/teams-js/test/public/publicAPIs.spec.ts index 884036b1de..ab1906f1ec 100644 --- a/packages/teams-js/test/public/publicAPIs.spec.ts +++ b/packages/teams-js/test/public/publicAPIs.spec.ts @@ -348,7 +348,7 @@ describe('MicrosoftTeams-publicAPIs', () => { appSessionId: 'appSessionId', appLaunchId: 'appLaunchId', meetingId: 'dummyMeetingId', - internalAppId: 'dummyInternalAppId', + appId: 'dummyAppId', }; getContext((context) => { Object.keys(expectedContext).forEach((e) => { From 09d60af88a27a32797ebc0b6595be3c34738650e Mon Sep 17 00:00:00 2001 From: Vikram Thanigaivelan <116702367+vikramtha@users.noreply.github.com> Date: Tue, 2 Jul 2024 15:44:18 -0700 Subject: [PATCH 10/16] Update app.spec.ts --- packages/teams-js/test/public/app.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/teams-js/test/public/app.spec.ts b/packages/teams-js/test/public/app.spec.ts index 5134ccb003..81d49d37a7 100644 --- a/packages/teams-js/test/public/app.spec.ts +++ b/packages/teams-js/test/public/app.spec.ts @@ -1432,7 +1432,7 @@ describe('Testing app capability', () => { appLaunchId: 'appLaunchId', userDisplayName: 'someTestUser', teamSiteId: 'someSiteId', - appId: 'appId', + appId: 'someAppId', }; const expectedContext: app.Context = { From 8079cc67aaeac70f42f5ba0649d37a4a57498879 Mon Sep 17 00:00:00 2001 From: vikramtha Date: Wed, 10 Jul 2024 12:03:24 -0700 Subject: [PATCH 11/16] Make appID now a required param in the interface as there will always be a value --- packages/teams-js/src/public/app.ts | 2 +- packages/teams-js/src/public/interfaces.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/teams-js/src/public/app.ts b/packages/teams-js/src/public/app.ts index 47f33d23cd..c3623af73f 100644 --- a/packages/teams-js/src/public/app.ts +++ b/packages/teams-js/src/public/app.ts @@ -358,7 +358,7 @@ export namespace app { /** * App id that is used by Hosts to distinguish between different apps sideloaded or in store */ - appId?: string; + appId: string; } /** diff --git a/packages/teams-js/src/public/interfaces.ts b/packages/teams-js/src/public/interfaces.ts index f57769b3fe..61e3949cf0 100644 --- a/packages/teams-js/src/public/interfaces.ts +++ b/packages/teams-js/src/public/interfaces.ts @@ -765,7 +765,7 @@ export interface Context { * * App id that is used by Hosts to distinguish between different apps sideloaded or in store */ - appId?: string; + appId: string; } /** Represents the parameters used to share a deep link. */ From 57800717007d5c6511d51e0ba15af2ecbec6cf74 Mon Sep 17 00:00:00 2001 From: vikramtha Date: Wed, 10 Jul 2024 12:55:01 -0700 Subject: [PATCH 12/16] Updated test cases --- packages/teams-js/test/private/privateAPIs.spec.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/teams-js/test/private/privateAPIs.spec.ts b/packages/teams-js/test/private/privateAPIs.spec.ts index 886e4aab6c..05e7da4f61 100644 --- a/packages/teams-js/test/private/privateAPIs.spec.ts +++ b/packages/teams-js/test/private/privateAPIs.spec.ts @@ -244,6 +244,7 @@ describe('AppSDK-privateAPIs', () => { clientType: HostClientType.web, sessionId: '', }, + appId: 'someAppId', }, page: { id: 'someEntityId1', @@ -274,6 +275,7 @@ describe('AppSDK-privateAPIs', () => { clientType: HostClientType.web, sessionId: '', }, + appId: 'someAppId', }, page: { id: 'someEntityId2', @@ -304,6 +306,7 @@ describe('AppSDK-privateAPIs', () => { clientType: HostClientType.web, sessionId: '', }, + appId: 'someAppId', }, page: { id: 'someEntityId3', From 2c74249a5a8651de01d0e8afb9082ea8a2c63984 Mon Sep 17 00:00:00 2001 From: vikramtha Date: Wed, 10 Jul 2024 14:05:53 -0700 Subject: [PATCH 13/16] Updated test cases to properly work with requried param --- packages/teams-js/test/private/privateAPIs.spec.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/teams-js/test/private/privateAPIs.spec.ts b/packages/teams-js/test/private/privateAPIs.spec.ts index 05e7da4f61..3297b03542 100644 --- a/packages/teams-js/test/private/privateAPIs.spec.ts +++ b/packages/teams-js/test/private/privateAPIs.spec.ts @@ -233,6 +233,7 @@ describe('AppSDK-privateAPIs', () => { channelId: 'someChannelId1', entityId: 'someEntityId1', userObjectId: 'someUserObjectId1', + appId: 'someAppId', }; const expectedContext1: app.Context = { app: { @@ -264,6 +265,7 @@ describe('AppSDK-privateAPIs', () => { channelId: 'someChannelId2', entityId: 'someEntityId2', userObjectId: 'someUserObjectId2', + appId: 'someAppId', }; const expectedContext2: app.Context = { app: { @@ -295,6 +297,7 @@ describe('AppSDK-privateAPIs', () => { channelId: 'someChannelId3', entityId: 'someEntityId3', userObjectId: 'someUserObjectId3', + appId: 'someAppId', }; const expectedContext3: app.Context = { app: { From c96f356875577af9c6d94bab99fc710ebdcf3018 Mon Sep 17 00:00:00 2001 From: vikramtha Date: Wed, 10 Jul 2024 14:31:40 -0700 Subject: [PATCH 14/16] another one --- packages/teams-js/test/private/privateAPIs.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/teams-js/test/private/privateAPIs.spec.ts b/packages/teams-js/test/private/privateAPIs.spec.ts index 3297b03542..2e900c7e54 100644 --- a/packages/teams-js/test/private/privateAPIs.spec.ts +++ b/packages/teams-js/test/private/privateAPIs.spec.ts @@ -362,6 +362,7 @@ describe('AppSDK-privateAPIs', () => { userClickTime: 1000, teamTemplateId: 'com.microsoft.teams.ManageAProject', userFileOpenPreference: FileOpenPreference.Web, + appId: 'someappId', }; // Get many responses to the same message From 17bcf30d8ab191e1c340b5322799b4bd15ab443c Mon Sep 17 00:00:00 2001 From: Trevor Harris Date: Tue, 13 Aug 2024 15:15:23 -0700 Subject: [PATCH 15/16] Update change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json --- ...microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json b/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json index 1f69f21045..a2d0c8349f 100644 --- a/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json +++ b/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json @@ -1,6 +1,6 @@ { "type": "minor", - "comment": "Added a new parameter to `getContext()` API called `appId` for App ID used in deeplinks and by hosts to identify apps", + "comment": "Added a new parameter to `app.getContext` called `appId` which contains the current application's AppId. This value is used in deeplinks and by hosts to identify apps", "packageName": "@microsoft/teams-js", "email": "vikramtha@microsoft.com", "dependentChangeType": "patch" From 6a26ec438b20018b19f3e809f70e144f13601ae4 Mon Sep 17 00:00:00 2001 From: Trevor Harris Date: Thu, 15 Aug 2024 10:05:45 -0700 Subject: [PATCH 16/16] Update change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json --- ...microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json b/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json index a2d0c8349f..cffa37ae3c 100644 --- a/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json +++ b/change/@microsoft-teams-js-07a56fbc-6d3e-474d-b3d9-6c6fe3a3be50.json @@ -1,6 +1,6 @@ { "type": "minor", - "comment": "Added a new parameter to `app.getContext` called `appId` which contains the current application's AppId. This value is used in deeplinks and by hosts to identify apps", + "comment": "Added a new parameter to `app.getContext` called `appId` which contains the current application's AppId. This value is used in deeplinks and hosts to identify apps", "packageName": "@microsoft/teams-js", "email": "vikramtha@microsoft.com", "dependentChangeType": "patch"