From c243d23f07b0fa8434bd1bda976bacaa00c4cbfb Mon Sep 17 00:00:00 2001 From: Martin Machacek Date: Tue, 31 Oct 2023 07:45:04 +0100 Subject: [PATCH 1/4] Enhancement: Run "pa app get" as admin --- docs/docs/cmd/pa/app/app-get.mdx | 15 +++++++ src/m365/pa/commands/app/app-get.spec.ts | 56 +++++++++++++++++++++++- src/m365/pa/commands/app/app-get.ts | 22 +++++++++- 3 files changed, 90 insertions(+), 3 deletions(-) diff --git a/docs/docs/cmd/pa/app/app-get.mdx b/docs/docs/cmd/pa/app/app-get.mdx index de6ba4115be..f8c72f76cca 100644 --- a/docs/docs/cmd/pa/app/app-get.mdx +++ b/docs/docs/cmd/pa/app/app-get.mdx @@ -20,6 +20,12 @@ m365 pa app get [options] `-d, --displayName [displayName]` : The display name of the Microsoft Power App to get information about. + +`-e, --environmentName [environmentName]` +: The name of the environment for which to retrieve the specified app. + +`--asAdmin` +: Set, to get the Power App as admin. Otherwise will return only your own app. ``` @@ -32,6 +38,9 @@ This command is based on an API that is currently in preview and is subject to c ::: +As maker, you are able to retrieve the Power Apps you own. As administrator, you are also able to retrieve Power Apps from other users. To get the app from other user, use the `asAdmin` option and make sure to specify the `environment` option. You cannot specify only one of the options, when specifying the `environment` option the `asAdmin` option has to be present as well. + + If you try to retrieve a non-existing Microsoft Power App, you will get the `Request failed with status code 404` error. ## Examples @@ -48,6 +57,12 @@ Get information about the specified Microsoft Power App by the app's display nam m365 pa app get --displayName App ``` +Get information about the specified Microsoft Power App from a given environment by the app's name. + +```sh +m365 pa app get --name 3989cb59-ce1a-4a5c-bb78-257c5c39381d --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --asAdmin +``` + ## Response diff --git a/src/m365/pa/commands/app/app-get.spec.ts b/src/m365/pa/commands/app/app-get.spec.ts index 4372c9ae7e7..f1c84e56bc8 100644 --- a/src/m365/pa/commands/app/app-get.spec.ts +++ b/src/m365/pa/commands/app/app-get.spec.ts @@ -151,7 +151,24 @@ describe(commands.APP_GET, () => { assert(loggerLogSpy.calledWith({ "name": "5369f386-e380-46cb-82a4-4e18f9e4f3a7", "id": "/providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7", "type": "Microsoft.PowerApps/apps", "tags": { "primaryDeviceWidth": "640", "primaryDeviceHeight": "1136", "sienaVersion": "20210118T125447Z-3.20123.24.0", "deviceCapabilities": "", "supportsPortrait": "true", "supportsLandscape": "false", "primaryFormFactor": "Phone", "publisherVersion": "3.20123.24", "minimumRequiredApiVersion": "2.2.0", "hasComponent": "false", "hasUnlockedComponent": "false", "isUnifiedRootApp": "false" }, "properties": { "appVersion": "2021-01-18T12:54:47Z", "createdByClientVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "minClientVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "owner": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "createdBy": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "lastModifiedBy": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "backgroundColor": "rgba(0, 176, 240, 1)", "backgroundImageUri": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/logoSmallFile?sv=2018-03-28&sr=c&sig=Y5OvBpqU9EXwpXthPre62%2B24zwCNS9ihPfCNmBmuXro%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "teamsColorIconUrl": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z7f1ae936e0c84483a435f047250f9a90/teamsColorIcon.png?sv=2018-03-28&sr=c&sig=ECrnlPPWWirepGA0BwPAfi3RDcNxugeuBajcE9DvJcI%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "teamsOutlineIconUrl": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z7f1ae936e0c84483a435f047250f9a90/teamsOutlineIcon.png?sv=2018-03-28&sr=c&sig=ECrnlPPWWirepGA0BwPAfi3RDcNxugeuBajcE9DvJcI%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "displayName": "App", "description": "", "appUris": { "documentUri": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/document.msapp?sv=2018-03-28&sr=c&sig=bx4dLMgjOurFPWW%2FuanqlJlb1clSqH05cZDPgbEkEno%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/document.msapp?sv=2018-03-28&sr=c&sig=bx4dLMgjOurFPWW%2FuanqlJlb1clSqH05cZDPgbEkEno%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "imageUris": [] }, "createdTime": "2021-01-18T12:54:47.9591484Z", "lastModifiedTime": "2021-01-18T12:54:48.0998249Z", "sharedGroupsCount": 0, "sharedUsersCount": 0, "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7", "appOpenUri": "https://apps.powerapps.com/play/5369f386-e380-46cb-82a4-4e18f9e4f3a7?tenantId=2ca3eaa5-140f-4175-9563-1172edf9f339&hint=c67d9086-a429-45b8-8b19-91fab5174177", "connectionReferences": { "c189738b-6a2d-4713-939d-e2ed35101124": { "id": "/providers/microsoft.powerapps/apis/shared_sharepointonline", "displayName": "SharePoint", "iconUri": "https://connectoricons-prod.azureedge.net/releases/v1.0.1431/1.0.1431.2301/sharepointonline/icon.png", "dataSources": ["ICT Aanvragen"], "dependencies": [], "dependents": [], "parameterHints": {}, "isOnPremiseConnection": false, "bypassConsent": false, "apiTier": "Standard", "isCustomApiConnection": false } }, "userAppMetadata": { "favorite": "NotSpecified", "includeInAppsList": true }, "isFeaturedApp": false, "bypassConsent": false, "isHeroApp": false, "environment": { "id": "/providers/Microsoft.PowerApps/environments/Default-2ca3eaa5-140f-4175-9563-1172edf9f339", "name": "Default-2ca3eaa5-140f-4175-9563-1172edf9f339" }, "appPackageDetails": { "playerPackage": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/player.msappk?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/player.msappk?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "webPackage": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/web/index.web.html?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/web/index.web.html?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "unauthenticatedWebPackage": { "value": "https://pafeblobprodam.blob.core.windows.net/alt20210118t000000z84a0aa047e784c87b15a6529a8f7ab50/20210118T125458Z/index.web.html" }, "documentServerVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "appPackageResourcesKind": "Split", "packagePropertiesJson": "{\"cdnUrl\":\"https://content.powerapps.com/resource/app\",\"preLoadIdx\":\"https://content.powerapps.com/resource/app/a5ccjkurht6g5/preloadindex.web.html\",\"id\":\"637465712959244709\",\"v\":2.1}" }, "almMode": "Environment", "performanceOptimizationEnabled": true, "unauthenticatedWebPackageHint": "c67d9086-a429-45b8-8b19-91fab5174177", "canConsumeAppPass": true, "executionRestrictions": { "isTeamsOnly": false, "dataLossPreventionEvaluationResult": { "status": "Compliant", "lastEvaluationDate": "2021-01-18T12:54:58.0824718Z", "violationDetails": [] } }, "appPlanClassification": "Standard", "usesPremiumApi": false, "usesOnlyGrandfatheredPremiumApis": true, "usesCustomApi": false, "usesOnPremiseGateway": false, "isCustomizable": true }, "isAppComponentLibrary": false, "appType": "ClassicCanvasApp", displayName: 'App', description: '', appVersion: '2021-01-18T12:54:47Z', owner: 'admin@contoso.com' })); }); - it(`retrieves information about the specified app using displayName`, async () => { + it('retrieves information about the specified app using name as admin', async () => { + sinon.stub(request, 'get').callsFake(async (opts) => { + if ((opts.url as string).indexOf(`providers/Microsoft.PowerApps/scopes/admin/environments/4ce50206-9576-4237-8b17-38d8aadfaa35/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7?api-version=2016-11-01`) > -1) { + if (opts.headers && + opts.headers.accept && + (opts.headers.accept as string).indexOf('application/json') === 0) { + return { "name": "5369f386-e380-46cb-82a4-4e18f9e4f3a7", "id": "/providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7", "type": "Microsoft.PowerApps/apps", "tags": { "primaryDeviceWidth": "640", "primaryDeviceHeight": "1136", "sienaVersion": "20210118T125447Z-3.20123.24.0", "deviceCapabilities": "", "supportsPortrait": "true", "supportsLandscape": "false", "primaryFormFactor": "Phone", "publisherVersion": "3.20123.24", "minimumRequiredApiVersion": "2.2.0", "hasComponent": "false", "hasUnlockedComponent": "false", "isUnifiedRootApp": "false" }, "properties": { "appVersion": "2021-01-18T12:54:47Z", "createdByClientVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "minClientVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "owner": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "createdBy": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "lastModifiedBy": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "backgroundColor": "rgba(0, 176, 240, 1)", "backgroundImageUri": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/logoSmallFile?sv=2018-03-28&sr=c&sig=Y5OvBpqU9EXwpXthPre62%2B24zwCNS9ihPfCNmBmuXro%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "teamsColorIconUrl": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z7f1ae936e0c84483a435f047250f9a90/teamsColorIcon.png?sv=2018-03-28&sr=c&sig=ECrnlPPWWirepGA0BwPAfi3RDcNxugeuBajcE9DvJcI%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "teamsOutlineIconUrl": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z7f1ae936e0c84483a435f047250f9a90/teamsOutlineIcon.png?sv=2018-03-28&sr=c&sig=ECrnlPPWWirepGA0BwPAfi3RDcNxugeuBajcE9DvJcI%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "displayName": "App", "description": "", "appUris": { "documentUri": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/document.msapp?sv=2018-03-28&sr=c&sig=bx4dLMgjOurFPWW%2FuanqlJlb1clSqH05cZDPgbEkEno%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/document.msapp?sv=2018-03-28&sr=c&sig=bx4dLMgjOurFPWW%2FuanqlJlb1clSqH05cZDPgbEkEno%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "imageUris": [] }, "createdTime": "2021-01-18T12:54:47.9591484Z", "lastModifiedTime": "2021-01-18T12:54:48.0998249Z", "sharedGroupsCount": 0, "sharedUsersCount": 0, "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7", "appOpenUri": "https://apps.powerapps.com/play/5369f386-e380-46cb-82a4-4e18f9e4f3a7?tenantId=2ca3eaa5-140f-4175-9563-1172edf9f339&hint=c67d9086-a429-45b8-8b19-91fab5174177", "connectionReferences": { "c189738b-6a2d-4713-939d-e2ed35101124": { "id": "/providers/microsoft.powerapps/apis/shared_sharepointonline", "displayName": "SharePoint", "iconUri": "https://connectoricons-prod.azureedge.net/releases/v1.0.1431/1.0.1431.2301/sharepointonline/icon.png", "dataSources": ["ICT Aanvragen"], "dependencies": [], "dependents": [], "parameterHints": {}, "isOnPremiseConnection": false, "bypassConsent": false, "apiTier": "Standard", "isCustomApiConnection": false } }, "userAppMetadata": { "favorite": "NotSpecified", "includeInAppsList": true }, "isFeaturedApp": false, "bypassConsent": false, "isHeroApp": false, "environment": { "id": "/providers/Microsoft.PowerApps/environments/Default-2ca3eaa5-140f-4175-9563-1172edf9f339", "name": "Default-2ca3eaa5-140f-4175-9563-1172edf9f339" }, "appPackageDetails": { "playerPackage": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/player.msappk?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/player.msappk?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "webPackage": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/web/index.web.html?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/web/index.web.html?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "unauthenticatedWebPackage": { "value": "https://pafeblobprodam.blob.core.windows.net/alt20210118t000000z84a0aa047e784c87b15a6529a8f7ab50/20210118T125458Z/index.web.html" }, "documentServerVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "appPackageResourcesKind": "Split", "packagePropertiesJson": "{\"cdnUrl\":\"https://content.powerapps.com/resource/app\",\"preLoadIdx\":\"https://content.powerapps.com/resource/app/a5ccjkurht6g5/preloadindex.web.html\",\"id\":\"637465712959244709\",\"v\":2.1}" }, "almMode": "Environment", "performanceOptimizationEnabled": true, "unauthenticatedWebPackageHint": "c67d9086-a429-45b8-8b19-91fab5174177", "canConsumeAppPass": true, "executionRestrictions": { "isTeamsOnly": false, "dataLossPreventionEvaluationResult": { "status": "Compliant", "lastEvaluationDate": "2021-01-18T12:54:58.0824718Z", "violationDetails": [] } }, "appPlanClassification": "Standard", "usesPremiumApi": false, "usesOnlyGrandfatheredPremiumApis": true, "usesCustomApi": false, "usesOnPremiseGateway": false, "isCustomizable": true }, "isAppComponentLibrary": false, "appType": "ClassicCanvasApp" }; + } + } + + throw 'Invalid request'; + }); + + await command.action(logger, { options: { name: '5369f386-e380-46cb-82a4-4e18f9e4f3a7', environmentName: '4ce50206-9576-4237-8b17-38d8aadfaa35', asAdmin: true } }); + assert(loggerLogSpy.calledWith({ "name": "5369f386-e380-46cb-82a4-4e18f9e4f3a7", "id": "/providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7", "type": "Microsoft.PowerApps/apps", "tags": { "primaryDeviceWidth": "640", "primaryDeviceHeight": "1136", "sienaVersion": "20210118T125447Z-3.20123.24.0", "deviceCapabilities": "", "supportsPortrait": "true", "supportsLandscape": "false", "primaryFormFactor": "Phone", "publisherVersion": "3.20123.24", "minimumRequiredApiVersion": "2.2.0", "hasComponent": "false", "hasUnlockedComponent": "false", "isUnifiedRootApp": "false" }, "properties": { "appVersion": "2021-01-18T12:54:47Z", "createdByClientVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "minClientVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "owner": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "createdBy": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "lastModifiedBy": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "backgroundColor": "rgba(0, 176, 240, 1)", "backgroundImageUri": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/logoSmallFile?sv=2018-03-28&sr=c&sig=Y5OvBpqU9EXwpXthPre62%2B24zwCNS9ihPfCNmBmuXro%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "teamsColorIconUrl": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z7f1ae936e0c84483a435f047250f9a90/teamsColorIcon.png?sv=2018-03-28&sr=c&sig=ECrnlPPWWirepGA0BwPAfi3RDcNxugeuBajcE9DvJcI%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "teamsOutlineIconUrl": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z7f1ae936e0c84483a435f047250f9a90/teamsOutlineIcon.png?sv=2018-03-28&sr=c&sig=ECrnlPPWWirepGA0BwPAfi3RDcNxugeuBajcE9DvJcI%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "displayName": "App", "description": "", "appUris": { "documentUri": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/document.msapp?sv=2018-03-28&sr=c&sig=bx4dLMgjOurFPWW%2FuanqlJlb1clSqH05cZDPgbEkEno%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/document.msapp?sv=2018-03-28&sr=c&sig=bx4dLMgjOurFPWW%2FuanqlJlb1clSqH05cZDPgbEkEno%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "imageUris": [] }, "createdTime": "2021-01-18T12:54:47.9591484Z", "lastModifiedTime": "2021-01-18T12:54:48.0998249Z", "sharedGroupsCount": 0, "sharedUsersCount": 0, "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7", "appOpenUri": "https://apps.powerapps.com/play/5369f386-e380-46cb-82a4-4e18f9e4f3a7?tenantId=2ca3eaa5-140f-4175-9563-1172edf9f339&hint=c67d9086-a429-45b8-8b19-91fab5174177", "connectionReferences": { "c189738b-6a2d-4713-939d-e2ed35101124": { "id": "/providers/microsoft.powerapps/apis/shared_sharepointonline", "displayName": "SharePoint", "iconUri": "https://connectoricons-prod.azureedge.net/releases/v1.0.1431/1.0.1431.2301/sharepointonline/icon.png", "dataSources": ["ICT Aanvragen"], "dependencies": [], "dependents": [], "parameterHints": {}, "isOnPremiseConnection": false, "bypassConsent": false, "apiTier": "Standard", "isCustomApiConnection": false } }, "userAppMetadata": { "favorite": "NotSpecified", "includeInAppsList": true }, "isFeaturedApp": false, "bypassConsent": false, "isHeroApp": false, "environment": { "id": "/providers/Microsoft.PowerApps/environments/Default-2ca3eaa5-140f-4175-9563-1172edf9f339", "name": "Default-2ca3eaa5-140f-4175-9563-1172edf9f339" }, "appPackageDetails": { "playerPackage": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/player.msappk?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/player.msappk?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "webPackage": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/web/index.web.html?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/web/index.web.html?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "unauthenticatedWebPackage": { "value": "https://pafeblobprodam.blob.core.windows.net/alt20210118t000000z84a0aa047e784c87b15a6529a8f7ab50/20210118T125458Z/index.web.html" }, "documentServerVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "appPackageResourcesKind": "Split", "packagePropertiesJson": "{\"cdnUrl\":\"https://content.powerapps.com/resource/app\",\"preLoadIdx\":\"https://content.powerapps.com/resource/app/a5ccjkurht6g5/preloadindex.web.html\",\"id\":\"637465712959244709\",\"v\":2.1}" }, "almMode": "Environment", "performanceOptimizationEnabled": true, "unauthenticatedWebPackageHint": "c67d9086-a429-45b8-8b19-91fab5174177", "canConsumeAppPass": true, "executionRestrictions": { "isTeamsOnly": false, "dataLossPreventionEvaluationResult": { "status": "Compliant", "lastEvaluationDate": "2021-01-18T12:54:58.0824718Z", "violationDetails": [] } }, "appPlanClassification": "Standard", "usesPremiumApi": false, "usesOnlyGrandfatheredPremiumApis": true, "usesCustomApi": false, "usesOnPremiseGateway": false, "isCustomizable": true }, "isAppComponentLibrary": false, "appType": "ClassicCanvasApp", displayName: 'App', description: '', appVersion: '2021-01-18T12:54:47Z', owner: 'admin@contoso.com' })); + }); + + it('retrieves information about the specified app using displayName', async () => { const apps = [ { "name": "4d4bb961-eef9-4258-8516-aa8d64e6b477", @@ -1996,4 +2013,41 @@ describe(commands.APP_GET, () => { }); assert(containsOption); }); + + it('supports specifying environment', () => { + const options = command.options; + let containsOption = false; + options.forEach(o => { + if (o.option.indexOf('--environment') > -1) { + containsOption = true; + } + }); + assert(containsOption); + }); + + it('supports specifying asAdmin', () => { + const options = command.options; + let containsOption = false; + options.forEach(o => { + if (o.option.indexOf('--asAdmin') > -1) { + containsOption = true; + } + }); + assert(containsOption); + }); + + it('fails validation if asAdmin specified without environment', async () => { + const actual = await command.validate({ options: { name: "5369f386-e380-46cb-82a4-4e18f9e4f3a7", asAdmin: true } }, commandInfo); + assert.notStrictEqual(actual, true); + }); + + it('fails validation if environment specified without admin', async () => { + const actual = await command.validate({ options: { name: "5369f386-e380-46cb-82a4-4e18f9e4f3a7", environmentName: 'Default-d87a7535-dd31-4437-bfe1-95340acd55c6' } }, commandInfo); + assert.notStrictEqual(actual, true); + }); + + it('passes validation if asAdmin specified with environment', async () => { + const actual = await command.validate({ options: { name: "5369f386-e380-46cb-82a4-4e18f9e4f3a7", asAdmin: true, environmentName: 'Default-d87a7535-dd31-4437-bfe1-95340acd55c6' } }, commandInfo); + assert.strictEqual(actual, true); + }); }); diff --git a/src/m365/pa/commands/app/app-get.ts b/src/m365/pa/commands/app/app-get.ts index e6e3eb45750..504063ce060 100644 --- a/src/m365/pa/commands/app/app-get.ts +++ b/src/m365/pa/commands/app/app-get.ts @@ -16,6 +16,8 @@ interface CommandArgs { interface Options extends GlobalOptions { name?: string; displayName?: string; + environmentName?: string; + asAdmin: boolean; } class PaAppGetCommand extends PowerAppsCommand { @@ -44,7 +46,9 @@ class PaAppGetCommand extends PowerAppsCommand { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { name: typeof args.options.name !== 'undefined', - displayName: typeof args.options.displayName !== 'undefined' + displayName: typeof args.options.displayName !== 'undefined', + asAdmin: args.options.asAdmin === true, + environmentName: typeof args.options.environmentName !== 'undefined' }); }); } @@ -56,6 +60,12 @@ class PaAppGetCommand extends PowerAppsCommand { }, { option: '-d, --displayName [displayName]' + }, + { + option: '-e, --environmentName [environmentName]' + }, + { + option: '--asAdmin' } ); } @@ -67,6 +77,14 @@ class PaAppGetCommand extends PowerAppsCommand { return `${args.options.name} is not a valid GUID`; } + if (args.options.asAdmin && !args.options.environmentName) { + return 'When specifying the asAdmin option the environment option is required as well'; + } + + if (args.options.environmentName && !args.options.asAdmin) { + return 'When specifying the environment option the asAdmin option is required as well'; + } + return true; } ); @@ -80,7 +98,7 @@ class PaAppGetCommand extends PowerAppsCommand { try { if (args.options.name) { const requestOptions: CliRequestOptions = { - url: `${this.resource}/providers/Microsoft.PowerApps/apps/${formatting.encodeQueryParameter(args.options.name)}?api-version=2016-11-01`, + url: `${this.resource}/providers/Microsoft.PowerApps${args.options.asAdmin ? '/scopes/admin' : ''}${args.options.environmentName ? '/environments/' + formatting.encodeQueryParameter(args.options.environmentName) : ''}/apps/${formatting.encodeQueryParameter(args.options.name)}?api-version=2016-11-01`, headers: { accept: 'application/json' }, From e6925d3a30cfff34be7bd446226b3dc6aaf230cb Mon Sep 17 00:00:00 2001 From: Martin Machacek Date: Sat, 16 Dec 2023 11:47:44 +0100 Subject: [PATCH 2/4] Enhancement: Run "pa app get" as admin --- docs/docs/cmd/pa/app/app-get.mdx | 10 +- src/m365/pa/commands/app/app-get.spec.ts | 695 +++++++++++++++++++++-- src/m365/pa/commands/app/app-get.ts | 8 +- 3 files changed, 657 insertions(+), 56 deletions(-) diff --git a/docs/docs/cmd/pa/app/app-get.mdx b/docs/docs/cmd/pa/app/app-get.mdx index fc5de1ec0ad..154315ab321 100644 --- a/docs/docs/cmd/pa/app/app-get.mdx +++ b/docs/docs/cmd/pa/app/app-get.mdx @@ -21,11 +21,11 @@ m365 pa app get [options] `-d, --displayName [displayName]` : The display name of the Microsoft Power App to get information about. -`-e, --environmentName [environmentName]` -: The name of the environment for which to retrieve the specified app. - `--asAdmin` : Set, to get the Power App as admin. Otherwise will return only your own app. + +`-e, --environmentName [environmentName]` +: The name of the environment for which to retrieve the specified app. ``` @@ -38,7 +38,7 @@ This command is based on an API that is currently in preview and is subject to c ::: -As maker, you are able to retrieve the Power Apps you own. As administrator, you are also able to retrieve Power Apps from other users. To get the app from other user, use the `asAdmin` option and make sure to specify the `environment` option. You cannot specify only one of the options, when specifying the `environment` option the `asAdmin` option has to be present as well. +As a maker, you are able to retrieve the Power Apps you own. As administrator, you are also able to retrieve Power Apps from other users. To get the app from another user, use the `asAdmin` option and make sure to specify the `environment` option as well. If you try to retrieve a non-existing Microsoft Power App, you will get the `Request failed with status code 404` error. @@ -57,7 +57,7 @@ Get information about the specified Microsoft Power App by the app's display nam m365 pa app get --displayName App ``` -Get information about the specified Microsoft Power App from a given environment by the app's name. +Get information about the specific app you do not have access to. ```sh m365 pa app get --name 3989cb59-ce1a-4a5c-bb78-257c5c39381d --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --asAdmin diff --git a/src/m365/pa/commands/app/app-get.spec.ts b/src/m365/pa/commands/app/app-get.spec.ts index b0e95d62f24..efe7c79ae6f 100644 --- a/src/m365/pa/commands/app/app-get.spec.ts +++ b/src/m365/pa/commands/app/app-get.spec.ts @@ -117,7 +117,7 @@ describe(commands.APP_GET, () => { it('retrieves information about the specified app using name (debug)', async () => { sinon.stub(request, 'get').callsFake(async (opts) => { - if ((opts.url as string).indexOf(`providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7?api-version=2016-11-01`) > -1) { + if (opts.url === `https://api.powerapps.com/providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7?api-version=2016-11-01`) { if (opts.headers && opts.headers.accept && (opts.headers.accept as string).indexOf('application/json') === 0) { @@ -134,7 +134,7 @@ describe(commands.APP_GET, () => { it('retrieves information about the specified app using name', async () => { sinon.stub(request, 'get').callsFake(async (opts) => { - if ((opts.url as string).indexOf(`providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7?api-version=2016-11-01`) > -1) { + if (opts.url === `https://api.powerapps.com/providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7?api-version=2016-11-01`) { if (opts.headers && opts.headers.accept && (opts.headers.accept as string).indexOf('application/json') === 0) { @@ -151,7 +151,7 @@ describe(commands.APP_GET, () => { it('retrieves information about the specified app using name as admin', async () => { sinon.stub(request, 'get').callsFake(async (opts) => { - if ((opts.url as string).indexOf(`providers/Microsoft.PowerApps/scopes/admin/environments/4ce50206-9576-4237-8b17-38d8aadfaa35/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7?api-version=2016-11-01`) > -1) { + if (opts.url === `https://api.powerapps.com/providers/Microsoft.PowerApps/scopes/admin/environments/4ce50206-9576-4237-8b17-38d8aadfaa35/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7?api-version=2016-11-01`) { if (opts.headers && opts.headers.accept && (opts.headers.accept as string).indexOf('application/json') === 0) { @@ -809,9 +809,652 @@ describe(commands.APP_GET, () => { )); }); + it('retrieves information about the specified app using displayName as admin', async () => { + const apps = [ + { + "name": "4d4bb961-eef9-4258-8516-aa8d64e6b477", + "id": "/providers/Microsoft.PowerApps/apps/4d4bb961-eef9-4258-8516-aa8d64e6b477", + "type": "Microsoft.PowerApps/apps", + "tags": { + "primaryDeviceWidth": "1366", + "primaryDeviceHeight": "768", + "sienaVersion": "20200512T062535Z-3.20023.8.0", + "deviceCapabilities": "", + "supportsPortrait": "false", + "supportsLandscape": "true", + "primaryFormFactor": "Tablet", + "publisherVersion": "3.20023.8", + "minimumRequiredApiVersion": "2.2.0", + "hasComponent": "false", + "hasUnlockedComponent": "false" + }, + "properties": { + "appVersion": "2020-07-08T12:28:37Z", + "lastDraftVersion": "2020-07-08T12:28:37Z", + "lifeCycleId": "Published", + "status": "Ready", + "createdByClientVersion": { + "major": 3, + "minor": 20023, + "build": 8, + "revision": 0, + "majorRevision": 0, + "minorRevision": 0 + }, + "minClientVersion": { + "major": 3, + "minor": 20023, + "build": 8, + "revision": 0, + "majorRevision": 0, + "minorRevision": 0 + }, + "owner": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "createdBy": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "lastModifiedBy": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "lastPublishedBy": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "backgroundColor": "rgba(37, 62, 143, 1)", + "backgroundImageUri": "https://pafeblobprodln.blob.core.windows.net:443/20200708t000000z4d9d5509e6c745d3bbd4d6d317890ccd/13103204444004720806/N0eb33631-4950-45e8-b569-8ba8611af629-logoSmallFile?sv=2018-03-28&sr=c&sig=rTJyePWWDMM6mvIhZaOkRsEdLxFE4X6UGXjrqrz3iYo%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", + "displayName": "Request-a-team", + "description": "", + "commitMessage": "", + "appUris": { + "documentUri": { + "value": "https://pafeblobprodln.blob.core.windows.net:443/20200708t000000z4d9d5509e6c745d3bbd4d6d317890ccd/13103204444004720806/N9d70c8fe-cbc0-4226-8818-372c4261e0c6-document.msapp?sv=2018-03-28&sr=c&sig=ltod6hA3brZQF9qTxNKFg0ryuX7IxsrJLY8KdA9u8f8%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", + "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200708t000000z4d9d5509e6c745d3bbd4d6d317890ccd/13103204444004720806/N9d70c8fe-cbc0-4226-8818-372c4261e0c6-document.msapp?sv=2018-03-28&sr=c&sig=ltod6hA3brZQF9qTxNKFg0ryuX7IxsrJLY8KdA9u8f8%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" + }, + "imageUris": [] + }, + "createdTime": "2020-07-08T12:28:37.957179Z", + "lastModifiedTime": "2020-07-08T12:28:38.7556554Z", + "lastPublishTime": "2020-07-08T12:28:37Z", + "sharedGroupsCount": 0, + "sharedUsersCount": 0, + "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/4d4bb961-eef9-4258-8516-aa8d64e6b477", + "appOpenUri": "https://apps.powerapps.com/play/4d4bb961-eef9-4258-8516-aa8d64e6b477?tenantId=e8954f17-a373-4b61-b54d-45c038fe3188", + "connectionReferences": { + "9d5036a3-8b23-4125-a5cc-7dc0dbb2f8cb": { + "id": "/providers/microsoft.powerapps/apis/shared_office365users", + "displayName": "Office 365 Users", + "iconUri": "https://connectoricons-prod.azureedge.net/office365users/icon_1.0.1357.2029.png", + "dataSources": [ + "Office365Users" + ], + "dependencies": [], + "dependents": [], + "isOnPremiseConnection": false, + "bypassConsent": false, + "dataSets": {}, + "apiTier": "Standard", + "isCustomApiConnection": false + }, + "a65df3f8-e66c-4cbd-b13f-458b7e96f677": { + "id": "/providers/microsoft.powerapps/apis/shared_office365groups", + "displayName": "Office 365 Groups", + "iconUri": "https://connectoricons-prod.azureedge.net/office365groups/icon_1.0.1329.1953.png", + "dataSources": [ + "Office365Groups" + ], + "dependencies": [], + "dependents": [], + "isOnPremiseConnection": false, + "bypassConsent": false, + "dataSets": {}, + "apiTier": "Standard", + "isCustomApiConnection": false + }, + "041cbeda-55ca-4c48-b8e3-03928fb72bb2": { + "id": "/providers/microsoft.powerapps/apis/shared_logicflows", + "displayName": "Logic flows", + "iconUri": "https://resourcestackdeploy.blob.core.windows.net/scripts/13276078.png", + "dataSources": [ + "CheckTeamAvailability" + ], + "dependencies": [ + "97e5ce6b-9f9a-4186-885f-9b5d6476c732" + ], + "dependents": [], + "isOnPremiseConnection": false, + "bypassConsent": false, + "dataSets": {}, + "apiTier": "Standard", + "isCustomApiConnection": false + }, + "97e5ce6b-9f9a-4186-885f-9b5d6476c732": { + "id": "/providers/microsoft.powerapps/apis/shared_sharepointonline", + "displayName": "SharePoint", + "iconUri": "https://connectoricons-prod.azureedge.net/sharepointonline/icon_1.0.1363.2042.png", + "dataSources": [], + "dependencies": [], + "dependents": [ + "041cbeda-55ca-4c48-b8e3-03928fb72bb2" + ], + "isOnPremiseConnection": false, + "bypassConsent": false, + "dataSets": {}, + "apiTier": "Standard", + "isCustomApiConnection": false + }, + "00deca03-387b-4ad4-bbd4-cefc640d1c9b": { + "id": "/providers/microsoft.powerapps/apis/shared_sharepointonline", + "displayName": "SharePoint", + "iconUri": "https://connectoricons-prod.azureedge.net/sharepointonline/icon_1.0.1363.2042.png", + "dataSources": [ + "Teams Templates", + "Teams Requests", + "Team Request Settings" + ], + "dependencies": [], + "dependents": [], + "isOnPremiseConnection": false, + "bypassConsent": false, + "dataSets": { + "https://contoso.sharepoint.com/sites/RequestateamApp": { + "dataSources": { + "Teams Templates": { + "tableName": "298485ad-73cc-4b5f-a013-b56111ec351a" + }, + "Teams Requests": { + "tableName": "a471ecf0-01f3-4e3e-902b-b48daaa23aba" + }, + "Team Request Settings": { + "tableName": "3770cede-bff2-42a6-ba12-2f4cbccb90d3" + } + } + } + }, + "apiTier": "Standard", + "isCustomApiConnection": false + } + }, + "databaseReferences": {}, + "userAppMetadata": { + "favorite": "NotSpecified", + "includeInAppsList": true + }, + "isFeaturedApp": false, + "bypassConsent": false, + "isHeroApp": false, + "environment": { + "id": "/providers/Microsoft.PowerApps/environments/Default-e8954f17-a373-4b61-b54d-45c038fe3188", + "name": "Default-e8954f17-a373-4b61-b54d-45c038fe3188" + }, + "almMode": "Environment", + "performanceOptimizationEnabled": false, + "canConsumeAppPass": true, + "appPlanClassification": "Standard", + "usesPremiumApi": false, + "usesOnlyGrandfatheredPremiumApis": true, + "usesCustomApi": false, + "usesOnPremiseGateway": false + }, + "isAppComponentLibrary": false, + "appType": "ClassicCanvasApp" + }, + { + "name": "79506a60-9c4c-4798-a1fa-aea552ef046e", + "id": "/providers/Microsoft.PowerApps/apps/79506a60-9c4c-4798-a1fa-aea552ef046e", + "type": "Microsoft.PowerApps/apps", + "tags": { + "minimumRequiredApiVersion": "2.2.0" + }, + "properties": { + "appVersion": "2020-06-08T20:52:24Z", + "lastDraftVersion": "2020-06-08T20:52:24Z", + "lifeCycleId": "Published", + "status": "Ready", + "createdByClientVersion": { + "major": 3, + "minor": 18114, + "build": 26, + "revision": 0, + "majorRevision": 0, + "minorRevision": 0 + }, + "minClientVersion": { + "major": 3, + "minor": 18114, + "build": 26, + "revision": 0, + "majorRevision": 0, + "minorRevision": 0 + }, + "owner": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "createdBy": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "lastModifiedBy": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "lastPublishedBy": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "backgroundColor": "rgba(0, 176, 240, 1)", + "backgroundImageUri": "https://pafeblobprodln.blob.core.windows.net:443/20200608t000000z1cbf48a3f3b54583b8932510cbdf20b0/6342866521103212774/N90efe94c-af45-4639-885e-d69f32cd6c9f-logoSmallFile?sv=2018-03-28&sr=c&sig=mm7Cj0z%2FlX42FaSCSA9MtwBxMVEEnveqb1%2FsQhfLsRw%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", + "displayName": "Toolkit", + "description": "", + "appUris": { + "documentUri": { + "value": "https://pafeblobprodln.blob.core.windows.net:443/20200608t000000z1cbf48a3f3b54583b8932510cbdf20b0/6342866521103212774/N1bc8ee4e-1a31-4917-86f8-b9309667d09b-document.msapp?sv=2018-03-28&sr=c&sig=vcph4RCCqlB6Hc78oScTcfdkMfj6dMggsvPxxqrBVpU%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", + "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200608t000000z1cbf48a3f3b54583b8932510cbdf20b0/6342866521103212774/N1bc8ee4e-1a31-4917-86f8-b9309667d09b-document.msapp?sv=2018-03-28&sr=c&sig=vcph4RCCqlB6Hc78oScTcfdkMfj6dMggsvPxxqrBVpU%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" + }, + "imageUris": [] + }, + "createdTime": "2020-06-08T20:52:24.1796831Z", + "lastModifiedTime": "2020-06-08T20:52:24.4140538Z", + "lastPublishTime": "2020-06-08T20:52:24Z", + "sharedGroupsCount": 0, + "sharedUsersCount": 0, + "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/79506a60-9c4c-4798-a1fa-aea552ef046e", + "appOpenUri": "https://apps.powerapps.com/play/79506a60-9c4c-4798-a1fa-aea552ef046e?tenantId=e8954f17-a373-4b61-b54d-45c038fe3188", + "databaseReferences": {}, + "userAppMetadata": { + "favorite": "NotSpecified", + "includeInAppsList": true + }, + "isFeaturedApp": false, + "bypassConsent": false, + "isHeroApp": false, + "environment": { + "id": "/providers/Microsoft.PowerApps/environments/Default-e8954f17-a373-4b61-b54d-45c038fe3188", + "name": "Default-e8954f17-a373-4b61-b54d-45c038fe3188" + }, + "almMode": "Environment", + "appPlanClassification": "Standard", + "usesPremiumApi": false, + "usesOnlyGrandfatheredPremiumApis": true, + "usesCustomApi": false, + "usesOnPremiseGateway": false + }, + "appType": "ClassicCanvasApp" + }, + { + "name": "f581c872-9852-4100-8e25-3d6891595204", + "id": "/providers/Microsoft.PowerApps/apps/f581c872-9852-4100-8e25-3d6891595204", + "type": "Microsoft.PowerApps/apps", + "tags": { + "primaryDeviceWidth": "640", + "primaryDeviceHeight": "1136", + "sienaVersion": "20200812T204016Z-3.20074.20.0", + "deviceCapabilities": "", + "supportsPortrait": "true", + "supportsLandscape": "false", + "primaryFormFactor": "Phone", + "publisherVersion": "3.20074.20", + "minimumRequiredApiVersion": "2.2.0", + "hasComponent": "false", + "hasUnlockedComponent": "false", + "isUnifiedRootApp": "false" + }, + "properties": { + "appVersion": "2020-08-12T20:40:16Z", + "lastDraftVersion": "2020-08-12T20:40:16Z", + "lifeCycleId": "Published", + "status": "Ready", + "createdByClientVersion": { + "major": 3, + "minor": 20074, + "build": 20, + "revision": 0, + "majorRevision": 0, + "minorRevision": 0 + }, + "minClientVersion": { + "major": 3, + "minor": 20074, + "build": 20, + "revision": 0, + "majorRevision": 0, + "minorRevision": 0 + }, + "owner": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "createdBy": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "lastModifiedBy": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "lastPublishedBy": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "backgroundColor": "rgba(0, 176, 240, 1)", + "backgroundImageUri": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z1766ec3fd78941bea695c957e898a62a/logoSmallFile?sv=2018-03-28&sr=c&sig=sqK6%2FXY4cHidwE%2Brb3JoBV3bNToOaA6EM3%2FczbWMQDc%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", + "teamsColorIconUrl": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/teamsColorIcon.png?sv=2018-03-28&sr=c&sig=UYs6LV%2BGqPjfNczXP80lm%2BmG1ebFNcLCF0D8MIJ6Lt8%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", + "teamsOutlineIconUrl": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/teamsOutlineIcon.png?sv=2018-03-28&sr=c&sig=UYs6LV%2BGqPjfNczXP80lm%2BmG1ebFNcLCF0D8MIJ6Lt8%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", + "displayName": "Playwright", + "description": "", + "commitMessage": "", + "appUris": { + "documentUri": { + "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z1766ec3fd78941bea695c957e898a62a/document.msapp?sv=2018-03-28&sr=c&sig=aToV3yl8gK0eiAPsh3DIxo3VC77OyLrZgYo2G%2BYXDgI%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", + "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z1766ec3fd78941bea695c957e898a62a/document.msapp?sv=2018-03-28&sr=c&sig=aToV3yl8gK0eiAPsh3DIxo3VC77OyLrZgYo2G%2BYXDgI%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" + }, + "imageUris": [] + }, + "createdTime": "2020-08-10T23:28:41.8191546Z", + "lastModifiedTime": "2020-08-12T20:40:20.3706202Z", + "lastPublishTime": "2020-08-12T20:40:20.3706202Z", + "sharedGroupsCount": 0, + "sharedUsersCount": 0, + "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/f581c872-9852-4100-8e25-3d6891595204", + "appOpenUri": "https://apps.powerapps.com/play/f581c872-9852-4100-8e25-3d6891595204?tenantId=e8954f17-a373-4b61-b54d-45c038fe3188", + "connectionReferences": { + "dd1ebcc1-9930-4e87-a680-45fb1eaf94e6": { + "id": "/providers/microsoft.powerapps/apis/shared_office365users", + "displayName": "Office 365 Users", + "iconUri": "https://connectoricons-prod.azureedge.net/releases/v1.0.1381/1.0.1381.2096/office365users/icon.png", + "dataSources": [ + "Office365Users" + ], + "dependencies": [], + "dependents": [], + "isOnPremiseConnection": false, + "bypassConsent": false, + "dataSets": {}, + "apiTier": "Standard", + "isCustomApiConnection": false + } + }, + "userAppMetadata": { + "favorite": "NotSpecified", + "lastOpenedTime": "2020-08-13T23:26:44.2982102Z", + "includeInAppsList": true + }, + "isFeaturedApp": false, + "bypassConsent": false, + "isHeroApp": false, + "environment": { + "id": "/providers/Microsoft.PowerApps/environments/Default-e8954f17-a373-4b61-b54d-45c038fe3188", + "name": "Default-e8954f17-a373-4b61-b54d-45c038fe3188" + }, + "appPackageDetails": { + "playerPackage": { + "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/player.msappk?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", + "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/player.msappk?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", + "sizeInBytes": 0 + }, + "webPackage": { + "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/web/index.web.html?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", + "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/web/index.web.html?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" + }, + "unauthenticatedWebPackage": { + "value": "https://pafeblobprodln.blob.core.windows.net/alt20200810t000000zc57cd52652b24a1eb573f7b2a36a10a9/20200812T204028Z/index.web.html" + }, + "documentServerVersion": { + "major": 3, + "minor": 20074, + "build": 20, + "revision": 0, + "majorRevision": 0, + "minorRevision": 0 + }, + "appPackageResourcesKind": "Split", + "packagePropertiesJson": "{\"cdnUrl\":\"https://content.powerapps.com/resource/app\",\"preLoadIdx\":\"https://content.powerapps.com/resource/app/4g3nunecadgk9/preloadindex.web.html\",\"id\":\"637328616254057865\",\"v\":2.1}" + }, + "almMode": "Environment", + "performanceOptimizationEnabled": true, + "unauthenticatedWebPackageHint": "1eef5df9-6032-459c-9194-77d926b11f37", + "canConsumeAppPass": true, + "appPlanClassification": "Standard", + "usesPremiumApi": false, + "usesOnlyGrandfatheredPremiumApis": true, + "usesCustomApi": false, + "usesOnPremiseGateway": false + }, + "isAppComponentLibrary": false, + "appType": "ClassicCanvasApp" + } + ]; + + sinon.stub(cli, 'executeCommandWithOutput').callsFake(async (command, args): Promise => { + if (command === paAppListCommand && args.options.environmentName === '4ce50206-9576-4237-8b17-38d8aadfaa35' && args.options.asAdmin) { + return { "stdout": JSON.stringify(apps) }; + } + throw 'Invalid request'; + }); + + await command.action(logger, { options: { displayName: 'Playwright', environmentName: '4ce50206-9576-4237-8b17-38d8aadfaa35', asAdmin: true } }); + assert(loggerLogSpy.calledWith( + { + "name": "f581c872-9852-4100-8e25-3d6891595204", + "id": "/providers/Microsoft.PowerApps/apps/f581c872-9852-4100-8e25-3d6891595204", + "type": "Microsoft.PowerApps/apps", + "tags": { + "primaryDeviceWidth": "640", + "primaryDeviceHeight": "1136", + "sienaVersion": "20200812T204016Z-3.20074.20.0", + "deviceCapabilities": "", + "supportsPortrait": "true", + "supportsLandscape": "false", + "primaryFormFactor": "Phone", + "publisherVersion": "3.20074.20", + "minimumRequiredApiVersion": "2.2.0", + "hasComponent": "false", + "hasUnlockedComponent": "false", + "isUnifiedRootApp": "false" + }, + "properties": { + "appVersion": "2020-08-12T20:40:16Z", + "lastDraftVersion": "2020-08-12T20:40:16Z", + "lifeCycleId": "Published", + "status": "Ready", + "createdByClientVersion": { + "major": 3, + "minor": 20074, + "build": 20, + "revision": 0, + "majorRevision": 0, + "minorRevision": 0 + }, + "minClientVersion": { + "major": 3, + "minor": 20074, + "build": 20, + "revision": 0, + "majorRevision": 0, + "minorRevision": 0 + }, + "owner": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "createdBy": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "lastModifiedBy": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "lastPublishedBy": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "backgroundColor": "rgba(0, 176, 240, 1)", + "backgroundImageUri": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z1766ec3fd78941bea695c957e898a62a/logoSmallFile?sv=2018-03-28&sr=c&sig=sqK6%2FXY4cHidwE%2Brb3JoBV3bNToOaA6EM3%2FczbWMQDc%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", + "teamsColorIconUrl": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/teamsColorIcon.png?sv=2018-03-28&sr=c&sig=UYs6LV%2BGqPjfNczXP80lm%2BmG1ebFNcLCF0D8MIJ6Lt8%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", + "teamsOutlineIconUrl": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/teamsOutlineIcon.png?sv=2018-03-28&sr=c&sig=UYs6LV%2BGqPjfNczXP80lm%2BmG1ebFNcLCF0D8MIJ6Lt8%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", + "displayName": "Playwright", + "description": "", + "commitMessage": "", + "appUris": { + "documentUri": { + "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z1766ec3fd78941bea695c957e898a62a/document.msapp?sv=2018-03-28&sr=c&sig=aToV3yl8gK0eiAPsh3DIxo3VC77OyLrZgYo2G%2BYXDgI%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", + "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z1766ec3fd78941bea695c957e898a62a/document.msapp?sv=2018-03-28&sr=c&sig=aToV3yl8gK0eiAPsh3DIxo3VC77OyLrZgYo2G%2BYXDgI%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" + }, + "imageUris": [] + }, + "createdTime": "2020-08-10T23:28:41.8191546Z", + "lastModifiedTime": "2020-08-12T20:40:20.3706202Z", + "lastPublishTime": "2020-08-12T20:40:20.3706202Z", + "sharedGroupsCount": 0, + "sharedUsersCount": 0, + "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/f581c872-9852-4100-8e25-3d6891595204", + "appOpenUri": "https://apps.powerapps.com/play/f581c872-9852-4100-8e25-3d6891595204?tenantId=e8954f17-a373-4b61-b54d-45c038fe3188", + "connectionReferences": { + "dd1ebcc1-9930-4e87-a680-45fb1eaf94e6": { + "id": "/providers/microsoft.powerapps/apis/shared_office365users", + "displayName": "Office 365 Users", + "iconUri": "https://connectoricons-prod.azureedge.net/releases/v1.0.1381/1.0.1381.2096/office365users/icon.png", + "dataSources": [ + "Office365Users" + ], + "dependencies": [], + "dependents": [], + "isOnPremiseConnection": false, + "bypassConsent": false, + "dataSets": {}, + "apiTier": "Standard", + "isCustomApiConnection": false + } + }, + "userAppMetadata": { + "favorite": "NotSpecified", + "lastOpenedTime": "2020-08-13T23:26:44.2982102Z", + "includeInAppsList": true + }, + "isFeaturedApp": false, + "bypassConsent": false, + "isHeroApp": false, + "environment": { + "id": "/providers/Microsoft.PowerApps/environments/Default-e8954f17-a373-4b61-b54d-45c038fe3188", + "name": "Default-e8954f17-a373-4b61-b54d-45c038fe3188" + }, + "appPackageDetails": { + "playerPackage": { + "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/player.msappk?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", + "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/player.msappk?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", + "sizeInBytes": 0 + }, + "webPackage": { + "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/web/index.web.html?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", + "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/web/index.web.html?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" + }, + "unauthenticatedWebPackage": { + "value": "https://pafeblobprodln.blob.core.windows.net/alt20200810t000000zc57cd52652b24a1eb573f7b2a36a10a9/20200812T204028Z/index.web.html" + }, + "documentServerVersion": { + "major": 3, + "minor": 20074, + "build": 20, + "revision": 0, + "majorRevision": 0, + "minorRevision": 0 + }, + "appPackageResourcesKind": "Split", + "packagePropertiesJson": "{\"cdnUrl\":\"https://content.powerapps.com/resource/app\",\"preLoadIdx\":\"https://content.powerapps.com/resource/app/4g3nunecadgk9/preloadindex.web.html\",\"id\":\"637328616254057865\",\"v\":2.1}" + }, + "almMode": "Environment", + "performanceOptimizationEnabled": true, + "unauthenticatedWebPackageHint": "1eef5df9-6032-459c-9194-77d926b11f37", + "canConsumeAppPass": true, + "appPlanClassification": "Standard", + "usesPremiumApi": false, + "usesOnlyGrandfatheredPremiumApis": true, + "usesCustomApi": false, + "usesOnPremiseGateway": false + }, + "isAppComponentLibrary": false, + "appType": "ClassicCanvasApp", + "displayName": "Playwright", + "description": "", + "appVersion": "2020-08-12T20:40:16Z", + "owner": "john.doe@contoso.onmicrosoft.com" + } + )); + }); + it('renders empty string for missing properties using name', async () => { sinon.stub(request, 'get').callsFake(async (opts) => { - if ((opts.url as string).indexOf(`providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7?api-version=2016-11-01`) > -1) { + if (opts.url === `https://api.powerapps.com/providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7?api-version=2016-11-01`) { if (opts.headers && opts.headers.accept && (opts.headers.accept as string).indexOf('application/json') === 0) { @@ -1990,50 +2633,6 @@ describe(commands.APP_GET, () => { new CommandError('An error has occurred')); }); - it('supports specifying name', () => { - const options = command.options; - let containsOption = false; - options.forEach(o => { - if (o.option.indexOf('--name') > -1) { - containsOption = true; - } - }); - assert(containsOption); - }); - - it('supports specifying displayName', () => { - const options = command.options; - let containsOption = false; - options.forEach(o => { - if (o.option.indexOf('--displayName') > -1) { - containsOption = true; - } - }); - assert(containsOption); - }); - - it('supports specifying environment', () => { - const options = command.options; - let containsOption = false; - options.forEach(o => { - if (o.option.indexOf('--environment') > -1) { - containsOption = true; - } - }); - assert(containsOption); - }); - - it('supports specifying asAdmin', () => { - const options = command.options; - let containsOption = false; - options.forEach(o => { - if (o.option.indexOf('--asAdmin') > -1) { - containsOption = true; - } - }); - assert(containsOption); - }); - it('fails validation if asAdmin specified without environment', async () => { const actual = await command.validate({ options: { name: "5369f386-e380-46cb-82a4-4e18f9e4f3a7", asAdmin: true } }, commandInfo); assert.notStrictEqual(actual, true); diff --git a/src/m365/pa/commands/app/app-get.ts b/src/m365/pa/commands/app/app-get.ts index 17437ae5250..7c79c80d536 100644 --- a/src/m365/pa/commands/app/app-get.ts +++ b/src/m365/pa/commands/app/app-get.ts @@ -17,7 +17,7 @@ interface Options extends GlobalOptions { name?: string; displayName?: string; environmentName?: string; - asAdmin: boolean; + asAdmin?: boolean; } class PaAppGetCommand extends PowerAppsCommand { @@ -47,7 +47,7 @@ class PaAppGetCommand extends PowerAppsCommand { Object.assign(this.telemetryProperties, { name: typeof args.options.name !== 'undefined', displayName: typeof args.options.displayName !== 'undefined', - asAdmin: args.options.asAdmin === true, + asAdmin: !!args.options.asAdmin, environmentName: typeof args.options.environmentName !== 'undefined' }); }); @@ -153,7 +153,9 @@ class PaAppGetCommand extends PowerAppsCommand { const options: GlobalOptions = { output: 'json', debug: this.debug, - verbose: this.verbose + verbose: this.verbose, + environmentName: args.options.environmentName, + asAdmin: args.options.asAdmin }; return await cli.executeCommandWithOutput(paAppListCommand as Command, { options: { ...options, _: [] } }); From 9e6fe7ad0a8a5b59097348d1f837923dfa8f8c09 Mon Sep 17 00:00:00 2001 From: Martin Machacek Date: Tue, 26 Dec 2023 18:31:14 +0100 Subject: [PATCH 3/4] Enhancement: Run "pa app get" as admin --- docs/docs/cmd/pa/app/app-get.mdx | 6 +- src/m365/pa/commands/app/app-get.spec.ts | 2839 ++++------------------ src/m365/pa/commands/app/app-get.ts | 7 +- 3 files changed, 484 insertions(+), 2368 deletions(-) diff --git a/docs/docs/cmd/pa/app/app-get.mdx b/docs/docs/cmd/pa/app/app-get.mdx index 154315ab321..a7bdd52ad3a 100644 --- a/docs/docs/cmd/pa/app/app-get.mdx +++ b/docs/docs/cmd/pa/app/app-get.mdx @@ -22,10 +22,10 @@ m365 pa app get [options] : The display name of the Microsoft Power App to get information about. `--asAdmin` -: Set, to get the Power App as admin. Otherwise will return only your own app. +: Run the command as admin for apps you don't have permission to. `-e, --environmentName [environmentName]` -: The name of the environment for which to retrieve the specified app. +: The name of the environment. Required when using `asAdmin`. ``` @@ -38,7 +38,7 @@ This command is based on an API that is currently in preview and is subject to c ::: -As a maker, you are able to retrieve the Power Apps you own. As administrator, you are also able to retrieve Power Apps from other users. To get the app from another user, use the `asAdmin` option and make sure to specify the `environment` option as well. +As a maker, you are able to retrieve the Power Apps you have permission to. As an administrator, you are also able to retrieve Power Apps from other users you don't have permission to. To get the app from another user, use the `asAdmin` option and make sure to specify the `environment` option as well. If you try to retrieve a non-existing Microsoft Power App, you will get the `Request failed with status code 404` error. diff --git a/src/m365/pa/commands/app/app-get.spec.ts b/src/m365/pa/commands/app/app-get.spec.ts index efe7c79ae6f..849dc77e0b5 100644 --- a/src/m365/pa/commands/app/app-get.spec.ts +++ b/src/m365/pa/commands/app/app-get.spec.ts @@ -22,6 +22,478 @@ describe(commands.APP_GET, () => { let commandInfo: CommandInfo; let loggerLogToStderrSpy: sinon.SinonSpy; + const apps = [ + { + "name": "4d4bb961-eef9-4258-8516-aa8d64e6b477", + "id": "/providers/Microsoft.PowerApps/apps/4d4bb961-eef9-4258-8516-aa8d64e6b477", + "type": "Microsoft.PowerApps/apps", + "tags": { + "primaryDeviceWidth": "1366", + "primaryDeviceHeight": "768", + "sienaVersion": "20200512T062535Z-3.20023.8.0", + "deviceCapabilities": "", + "supportsPortrait": "false", + "supportsLandscape": "true", + "primaryFormFactor": "Tablet", + "publisherVersion": "3.20023.8", + "minimumRequiredApiVersion": "2.2.0", + "hasComponent": "false", + "hasUnlockedComponent": "false" + }, + "properties": { + "appVersion": "2020-07-08T12:28:37Z", + "lastDraftVersion": "2020-07-08T12:28:37Z", + "lifeCycleId": "Published", + "status": "Ready", + "createdByClientVersion": { + "major": 3, + "minor": 20023, + "build": 8, + "revision": 0, + "majorRevision": 0, + "minorRevision": 0 + }, + "minClientVersion": { + "major": 3, + "minor": 20023, + "build": 8, + "revision": 0, + "majorRevision": 0, + "minorRevision": 0 + }, + "owner": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "createdBy": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "lastModifiedBy": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "lastPublishedBy": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "backgroundColor": "rgba(37, 62, 143, 1)", + "backgroundImageUri": "https://pafeblobprodln.blob.core.windows.net:443/20200708t000000z4d9d5509e6c745d3bbd4d6d317890ccd/13103204444004720806/N0eb33631-4950-45e8-b569-8ba8611af629-logoSmallFile?sv=2018-03-28&sr=c&sig=rTJyePWWDMM6mvIhZaOkRsEdLxFE4X6UGXjrqrz3iYo%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", + "displayName": "Request-a-team", + "description": "", + "commitMessage": "", + "appUris": { + "documentUri": { + "value": "https://pafeblobprodln.blob.core.windows.net:443/20200708t000000z4d9d5509e6c745d3bbd4d6d317890ccd/13103204444004720806/N9d70c8fe-cbc0-4226-8818-372c4261e0c6-document.msapp?sv=2018-03-28&sr=c&sig=ltod6hA3brZQF9qTxNKFg0ryuX7IxsrJLY8KdA9u8f8%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", + "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200708t000000z4d9d5509e6c745d3bbd4d6d317890ccd/13103204444004720806/N9d70c8fe-cbc0-4226-8818-372c4261e0c6-document.msapp?sv=2018-03-28&sr=c&sig=ltod6hA3brZQF9qTxNKFg0ryuX7IxsrJLY8KdA9u8f8%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" + }, + "imageUris": [] + }, + "createdTime": "2020-07-08T12:28:37.957179Z", + "lastModifiedTime": "2020-07-08T12:28:38.7556554Z", + "lastPublishTime": "2020-07-08T12:28:37Z", + "sharedGroupsCount": 0, + "sharedUsersCount": 0, + "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/4d4bb961-eef9-4258-8516-aa8d64e6b477", + "appOpenUri": "https://apps.powerapps.com/play/4d4bb961-eef9-4258-8516-aa8d64e6b477?tenantId=e8954f17-a373-4b61-b54d-45c038fe3188", + "connectionReferences": { + "9d5036a3-8b23-4125-a5cc-7dc0dbb2f8cb": { + "id": "/providers/microsoft.powerapps/apis/shared_office365users", + "displayName": "Office 365 Users", + "iconUri": "https://connectoricons-prod.azureedge.net/office365users/icon_1.0.1357.2029.png", + "dataSources": [ + "Office365Users" + ], + "dependencies": [], + "dependents": [], + "isOnPremiseConnection": false, + "bypassConsent": false, + "dataSets": {}, + "apiTier": "Standard", + "isCustomApiConnection": false + }, + "a65df3f8-e66c-4cbd-b13f-458b7e96f677": { + "id": "/providers/microsoft.powerapps/apis/shared_office365groups", + "displayName": "Office 365 Groups", + "iconUri": "https://connectoricons-prod.azureedge.net/office365groups/icon_1.0.1329.1953.png", + "dataSources": [ + "Office365Groups" + ], + "dependencies": [], + "dependents": [], + "isOnPremiseConnection": false, + "bypassConsent": false, + "dataSets": {}, + "apiTier": "Standard", + "isCustomApiConnection": false + }, + "041cbeda-55ca-4c48-b8e3-03928fb72bb2": { + "id": "/providers/microsoft.powerapps/apis/shared_logicflows", + "displayName": "Logic flows", + "iconUri": "https://resourcestackdeploy.blob.core.windows.net/scripts/13276078.png", + "dataSources": [ + "CheckTeamAvailability" + ], + "dependencies": [ + "97e5ce6b-9f9a-4186-885f-9b5d6476c732" + ], + "dependents": [], + "isOnPremiseConnection": false, + "bypassConsent": false, + "dataSets": {}, + "apiTier": "Standard", + "isCustomApiConnection": false + }, + "97e5ce6b-9f9a-4186-885f-9b5d6476c732": { + "id": "/providers/microsoft.powerapps/apis/shared_sharepointonline", + "displayName": "SharePoint", + "iconUri": "https://connectoricons-prod.azureedge.net/sharepointonline/icon_1.0.1363.2042.png", + "dataSources": [], + "dependencies": [], + "dependents": [ + "041cbeda-55ca-4c48-b8e3-03928fb72bb2" + ], + "isOnPremiseConnection": false, + "bypassConsent": false, + "dataSets": {}, + "apiTier": "Standard", + "isCustomApiConnection": false + }, + "00deca03-387b-4ad4-bbd4-cefc640d1c9b": { + "id": "/providers/microsoft.powerapps/apis/shared_sharepointonline", + "displayName": "SharePoint", + "iconUri": "https://connectoricons-prod.azureedge.net/sharepointonline/icon_1.0.1363.2042.png", + "dataSources": [ + "Teams Templates", + "Teams Requests", + "Team Request Settings" + ], + "dependencies": [], + "dependents": [], + "isOnPremiseConnection": false, + "bypassConsent": false, + "dataSets": { + "https://contoso.sharepoint.com/sites/RequestateamApp": { + "dataSources": { + "Teams Templates": { + "tableName": "298485ad-73cc-4b5f-a013-b56111ec351a" + }, + "Teams Requests": { + "tableName": "a471ecf0-01f3-4e3e-902b-b48daaa23aba" + }, + "Team Request Settings": { + "tableName": "3770cede-bff2-42a6-ba12-2f4cbccb90d3" + } + } + } + }, + "apiTier": "Standard", + "isCustomApiConnection": false + } + }, + "databaseReferences": {}, + "userAppMetadata": { + "favorite": "NotSpecified", + "includeInAppsList": true + }, + "isFeaturedApp": false, + "bypassConsent": false, + "isHeroApp": false, + "environment": { + "id": "/providers/Microsoft.PowerApps/environments/Default-e8954f17-a373-4b61-b54d-45c038fe3188", + "name": "Default-e8954f17-a373-4b61-b54d-45c038fe3188" + }, + "almMode": "Environment", + "performanceOptimizationEnabled": false, + "canConsumeAppPass": true, + "appPlanClassification": "Standard", + "usesPremiumApi": false, + "usesOnlyGrandfatheredPremiumApis": true, + "usesCustomApi": false, + "usesOnPremiseGateway": false + }, + "isAppComponentLibrary": false, + "appType": "ClassicCanvasApp" + }, + { + "name": "79506a60-9c4c-4798-a1fa-aea552ef046e", + "id": "/providers/Microsoft.PowerApps/apps/79506a60-9c4c-4798-a1fa-aea552ef046e", + "type": "Microsoft.PowerApps/apps", + "tags": { + "minimumRequiredApiVersion": "2.2.0" + }, + "properties": { + "appVersion": "2020-06-08T20:52:24Z", + "lastDraftVersion": "2020-06-08T20:52:24Z", + "lifeCycleId": "Published", + "status": "Ready", + "createdByClientVersion": { + "major": 3, + "minor": 18114, + "build": 26, + "revision": 0, + "majorRevision": 0, + "minorRevision": 0 + }, + "minClientVersion": { + "major": 3, + "minor": 18114, + "build": 26, + "revision": 0, + "majorRevision": 0, + "minorRevision": 0 + }, + "owner": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "createdBy": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "lastModifiedBy": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "lastPublishedBy": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "backgroundColor": "rgba(0, 176, 240, 1)", + "backgroundImageUri": "https://pafeblobprodln.blob.core.windows.net:443/20200608t000000z1cbf48a3f3b54583b8932510cbdf20b0/6342866521103212774/N90efe94c-af45-4639-885e-d69f32cd6c9f-logoSmallFile?sv=2018-03-28&sr=c&sig=mm7Cj0z%2FlX42FaSCSA9MtwBxMVEEnveqb1%2FsQhfLsRw%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", + "displayName": "Toolkit", + "description": "", + "appUris": { + "documentUri": { + "value": "https://pafeblobprodln.blob.core.windows.net:443/20200608t000000z1cbf48a3f3b54583b8932510cbdf20b0/6342866521103212774/N1bc8ee4e-1a31-4917-86f8-b9309667d09b-document.msapp?sv=2018-03-28&sr=c&sig=vcph4RCCqlB6Hc78oScTcfdkMfj6dMggsvPxxqrBVpU%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", + "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200608t000000z1cbf48a3f3b54583b8932510cbdf20b0/6342866521103212774/N1bc8ee4e-1a31-4917-86f8-b9309667d09b-document.msapp?sv=2018-03-28&sr=c&sig=vcph4RCCqlB6Hc78oScTcfdkMfj6dMggsvPxxqrBVpU%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" + }, + "imageUris": [] + }, + "createdTime": "2020-06-08T20:52:24.1796831Z", + "lastModifiedTime": "2020-06-08T20:52:24.4140538Z", + "lastPublishTime": "2020-06-08T20:52:24Z", + "sharedGroupsCount": 0, + "sharedUsersCount": 0, + "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/79506a60-9c4c-4798-a1fa-aea552ef046e", + "appOpenUri": "https://apps.powerapps.com/play/79506a60-9c4c-4798-a1fa-aea552ef046e?tenantId=e8954f17-a373-4b61-b54d-45c038fe3188", + "databaseReferences": {}, + "userAppMetadata": { + "favorite": "NotSpecified", + "includeInAppsList": true + }, + "isFeaturedApp": false, + "bypassConsent": false, + "isHeroApp": false, + "environment": { + "id": "/providers/Microsoft.PowerApps/environments/Default-e8954f17-a373-4b61-b54d-45c038fe3188", + "name": "Default-e8954f17-a373-4b61-b54d-45c038fe3188" + }, + "almMode": "Environment", + "appPlanClassification": "Standard", + "usesPremiumApi": false, + "usesOnlyGrandfatheredPremiumApis": true, + "usesCustomApi": false, + "usesOnPremiseGateway": false + }, + "appType": "ClassicCanvasApp" + }, + { + "name": "f581c872-9852-4100-8e25-3d6891595204", + "id": "/providers/Microsoft.PowerApps/apps/f581c872-9852-4100-8e25-3d6891595204", + "type": "Microsoft.PowerApps/apps", + "tags": { + "primaryDeviceWidth": "640", + "primaryDeviceHeight": "1136", + "sienaVersion": "20200812T204016Z-3.20074.20.0", + "deviceCapabilities": "", + "supportsPortrait": "true", + "supportsLandscape": "false", + "primaryFormFactor": "Phone", + "publisherVersion": "3.20074.20", + "minimumRequiredApiVersion": "2.2.0", + "hasComponent": "false", + "hasUnlockedComponent": "false", + "isUnifiedRootApp": "false" + }, + "properties": { + "appVersion": "2020-08-12T20:40:16Z", + "lastDraftVersion": "2020-08-12T20:40:16Z", + "lifeCycleId": "Published", + "status": "Ready", + "createdByClientVersion": { + "major": 3, + "minor": 20074, + "build": 20, + "revision": 0, + "majorRevision": 0, + "minorRevision": 0 + }, + "minClientVersion": { + "major": 3, + "minor": 20074, + "build": 20, + "revision": 0, + "majorRevision": 0, + "minorRevision": 0 + }, + "owner": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "createdBy": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "lastModifiedBy": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "lastPublishedBy": { + "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", + "displayName": "John Doe", + "email": "john.doe@contoso.onmicrosoft.com", + "type": "User", + "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", + "userPrincipalName": "john.doe@contoso.onmicrosoft.com" + }, + "backgroundColor": "rgba(0, 176, 240, 1)", + "backgroundImageUri": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z1766ec3fd78941bea695c957e898a62a/logoSmallFile?sv=2018-03-28&sr=c&sig=sqK6%2FXY4cHidwE%2Brb3JoBV3bNToOaA6EM3%2FczbWMQDc%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", + "teamsColorIconUrl": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/teamsColorIcon.png?sv=2018-03-28&sr=c&sig=UYs6LV%2BGqPjfNczXP80lm%2BmG1ebFNcLCF0D8MIJ6Lt8%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", + "teamsOutlineIconUrl": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/teamsOutlineIcon.png?sv=2018-03-28&sr=c&sig=UYs6LV%2BGqPjfNczXP80lm%2BmG1ebFNcLCF0D8MIJ6Lt8%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", + "displayName": "Playwright", + "description": "", + "commitMessage": "", + "appUris": { + "documentUri": { + "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z1766ec3fd78941bea695c957e898a62a/document.msapp?sv=2018-03-28&sr=c&sig=aToV3yl8gK0eiAPsh3DIxo3VC77OyLrZgYo2G%2BYXDgI%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", + "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z1766ec3fd78941bea695c957e898a62a/document.msapp?sv=2018-03-28&sr=c&sig=aToV3yl8gK0eiAPsh3DIxo3VC77OyLrZgYo2G%2BYXDgI%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" + }, + "imageUris": [] + }, + "createdTime": "2020-08-10T23:28:41.8191546Z", + "lastModifiedTime": "2020-08-12T20:40:20.3706202Z", + "lastPublishTime": "2020-08-12T20:40:20.3706202Z", + "sharedGroupsCount": 0, + "sharedUsersCount": 0, + "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/f581c872-9852-4100-8e25-3d6891595204", + "appOpenUri": "https://apps.powerapps.com/play/f581c872-9852-4100-8e25-3d6891595204?tenantId=e8954f17-a373-4b61-b54d-45c038fe3188", + "connectionReferences": { + "dd1ebcc1-9930-4e87-a680-45fb1eaf94e6": { + "id": "/providers/microsoft.powerapps/apis/shared_office365users", + "displayName": "Office 365 Users", + "iconUri": "https://connectoricons-prod.azureedge.net/releases/v1.0.1381/1.0.1381.2096/office365users/icon.png", + "dataSources": [ + "Office365Users" + ], + "dependencies": [], + "dependents": [], + "isOnPremiseConnection": false, + "bypassConsent": false, + "dataSets": {}, + "apiTier": "Standard", + "isCustomApiConnection": false + } + }, + "userAppMetadata": { + "favorite": "NotSpecified", + "lastOpenedTime": "2020-08-13T23:26:44.2982102Z", + "includeInAppsList": true + }, + "isFeaturedApp": false, + "bypassConsent": false, + "isHeroApp": false, + "environment": { + "id": "/providers/Microsoft.PowerApps/environments/Default-e8954f17-a373-4b61-b54d-45c038fe3188", + "name": "Default-e8954f17-a373-4b61-b54d-45c038fe3188" + }, + "appPackageDetails": { + "playerPackage": { + "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/player.msappk?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", + "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/player.msappk?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", + "sizeInBytes": 0 + }, + "webPackage": { + "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/web/index.web.html?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", + "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/web/index.web.html?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" + }, + "unauthenticatedWebPackage": { + "value": "https://pafeblobprodln.blob.core.windows.net/alt20200810t000000zc57cd52652b24a1eb573f7b2a36a10a9/20200812T204028Z/index.web.html" + }, + "documentServerVersion": { + "major": 3, + "minor": 20074, + "build": 20, + "revision": 0, + "majorRevision": 0, + "minorRevision": 0 + }, + "appPackageResourcesKind": "Split", + "packagePropertiesJson": "{\"cdnUrl\":\"https://content.powerapps.com/resource/app\",\"preLoadIdx\":\"https://content.powerapps.com/resource/app/4g3nunecadgk9/preloadindex.web.html\",\"id\":\"637328616254057865\",\"v\":2.1}" + }, + "almMode": "Environment", + "performanceOptimizationEnabled": true, + "unauthenticatedWebPackageHint": "1eef5df9-6032-459c-9194-77d926b11f37", + "canConsumeAppPass": true, + "appPlanClassification": "Standard", + "usesPremiumApi": false, + "usesOnlyGrandfatheredPremiumApis": true, + "usesCustomApi": false, + "usesOnPremiseGateway": false + }, + "isAppComponentLibrary": false, + "appType": "ClassicCanvasApp", + "displayName": "Playwright", + "description": "", + "appVersion": "2020-08-12T20:40:16Z", + "owner": "john.doe@contoso.onmicrosoft.com" + } + ]; + before(() => { sinon.stub(auth, 'restoreAuth').resolves(); sinon.stub(telemetry, 'trackEvent').returns(); @@ -167,474 +639,6 @@ describe(commands.APP_GET, () => { }); it('retrieves information about the specified app using displayName', async () => { - const apps = [ - { - "name": "4d4bb961-eef9-4258-8516-aa8d64e6b477", - "id": "/providers/Microsoft.PowerApps/apps/4d4bb961-eef9-4258-8516-aa8d64e6b477", - "type": "Microsoft.PowerApps/apps", - "tags": { - "primaryDeviceWidth": "1366", - "primaryDeviceHeight": "768", - "sienaVersion": "20200512T062535Z-3.20023.8.0", - "deviceCapabilities": "", - "supportsPortrait": "false", - "supportsLandscape": "true", - "primaryFormFactor": "Tablet", - "publisherVersion": "3.20023.8", - "minimumRequiredApiVersion": "2.2.0", - "hasComponent": "false", - "hasUnlockedComponent": "false" - }, - "properties": { - "appVersion": "2020-07-08T12:28:37Z", - "lastDraftVersion": "2020-07-08T12:28:37Z", - "lifeCycleId": "Published", - "status": "Ready", - "createdByClientVersion": { - "major": 3, - "minor": 20023, - "build": 8, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "minClientVersion": { - "major": 3, - "minor": 20023, - "build": 8, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "owner": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "createdBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastModifiedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastPublishedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "backgroundColor": "rgba(37, 62, 143, 1)", - "backgroundImageUri": "https://pafeblobprodln.blob.core.windows.net:443/20200708t000000z4d9d5509e6c745d3bbd4d6d317890ccd/13103204444004720806/N0eb33631-4950-45e8-b569-8ba8611af629-logoSmallFile?sv=2018-03-28&sr=c&sig=rTJyePWWDMM6mvIhZaOkRsEdLxFE4X6UGXjrqrz3iYo%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "displayName": "Request-a-team", - "description": "", - "commitMessage": "", - "appUris": { - "documentUri": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200708t000000z4d9d5509e6c745d3bbd4d6d317890ccd/13103204444004720806/N9d70c8fe-cbc0-4226-8818-372c4261e0c6-document.msapp?sv=2018-03-28&sr=c&sig=ltod6hA3brZQF9qTxNKFg0ryuX7IxsrJLY8KdA9u8f8%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200708t000000z4d9d5509e6c745d3bbd4d6d317890ccd/13103204444004720806/N9d70c8fe-cbc0-4226-8818-372c4261e0c6-document.msapp?sv=2018-03-28&sr=c&sig=ltod6hA3brZQF9qTxNKFg0ryuX7IxsrJLY8KdA9u8f8%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" - }, - "imageUris": [] - }, - "createdTime": "2020-07-08T12:28:37.957179Z", - "lastModifiedTime": "2020-07-08T12:28:38.7556554Z", - "lastPublishTime": "2020-07-08T12:28:37Z", - "sharedGroupsCount": 0, - "sharedUsersCount": 0, - "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/4d4bb961-eef9-4258-8516-aa8d64e6b477", - "appOpenUri": "https://apps.powerapps.com/play/4d4bb961-eef9-4258-8516-aa8d64e6b477?tenantId=e8954f17-a373-4b61-b54d-45c038fe3188", - "connectionReferences": { - "9d5036a3-8b23-4125-a5cc-7dc0dbb2f8cb": { - "id": "/providers/microsoft.powerapps/apis/shared_office365users", - "displayName": "Office 365 Users", - "iconUri": "https://connectoricons-prod.azureedge.net/office365users/icon_1.0.1357.2029.png", - "dataSources": [ - "Office365Users" - ], - "dependencies": [], - "dependents": [], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": {}, - "apiTier": "Standard", - "isCustomApiConnection": false - }, - "a65df3f8-e66c-4cbd-b13f-458b7e96f677": { - "id": "/providers/microsoft.powerapps/apis/shared_office365groups", - "displayName": "Office 365 Groups", - "iconUri": "https://connectoricons-prod.azureedge.net/office365groups/icon_1.0.1329.1953.png", - "dataSources": [ - "Office365Groups" - ], - "dependencies": [], - "dependents": [], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": {}, - "apiTier": "Standard", - "isCustomApiConnection": false - }, - "041cbeda-55ca-4c48-b8e3-03928fb72bb2": { - "id": "/providers/microsoft.powerapps/apis/shared_logicflows", - "displayName": "Logic flows", - "iconUri": "https://resourcestackdeploy.blob.core.windows.net/scripts/13276078.png", - "dataSources": [ - "CheckTeamAvailability" - ], - "dependencies": [ - "97e5ce6b-9f9a-4186-885f-9b5d6476c732" - ], - "dependents": [], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": {}, - "apiTier": "Standard", - "isCustomApiConnection": false - }, - "97e5ce6b-9f9a-4186-885f-9b5d6476c732": { - "id": "/providers/microsoft.powerapps/apis/shared_sharepointonline", - "displayName": "SharePoint", - "iconUri": "https://connectoricons-prod.azureedge.net/sharepointonline/icon_1.0.1363.2042.png", - "dataSources": [], - "dependencies": [], - "dependents": [ - "041cbeda-55ca-4c48-b8e3-03928fb72bb2" - ], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": {}, - "apiTier": "Standard", - "isCustomApiConnection": false - }, - "00deca03-387b-4ad4-bbd4-cefc640d1c9b": { - "id": "/providers/microsoft.powerapps/apis/shared_sharepointonline", - "displayName": "SharePoint", - "iconUri": "https://connectoricons-prod.azureedge.net/sharepointonline/icon_1.0.1363.2042.png", - "dataSources": [ - "Teams Templates", - "Teams Requests", - "Team Request Settings" - ], - "dependencies": [], - "dependents": [], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": { - "https://contoso.sharepoint.com/sites/RequestateamApp": { - "dataSources": { - "Teams Templates": { - "tableName": "298485ad-73cc-4b5f-a013-b56111ec351a" - }, - "Teams Requests": { - "tableName": "a471ecf0-01f3-4e3e-902b-b48daaa23aba" - }, - "Team Request Settings": { - "tableName": "3770cede-bff2-42a6-ba12-2f4cbccb90d3" - } - } - } - }, - "apiTier": "Standard", - "isCustomApiConnection": false - } - }, - "databaseReferences": {}, - "userAppMetadata": { - "favorite": "NotSpecified", - "includeInAppsList": true - }, - "isFeaturedApp": false, - "bypassConsent": false, - "isHeroApp": false, - "environment": { - "id": "/providers/Microsoft.PowerApps/environments/Default-e8954f17-a373-4b61-b54d-45c038fe3188", - "name": "Default-e8954f17-a373-4b61-b54d-45c038fe3188" - }, - "almMode": "Environment", - "performanceOptimizationEnabled": false, - "canConsumeAppPass": true, - "appPlanClassification": "Standard", - "usesPremiumApi": false, - "usesOnlyGrandfatheredPremiumApis": true, - "usesCustomApi": false, - "usesOnPremiseGateway": false - }, - "isAppComponentLibrary": false, - "appType": "ClassicCanvasApp" - }, - { - "name": "79506a60-9c4c-4798-a1fa-aea552ef046e", - "id": "/providers/Microsoft.PowerApps/apps/79506a60-9c4c-4798-a1fa-aea552ef046e", - "type": "Microsoft.PowerApps/apps", - "tags": { - "minimumRequiredApiVersion": "2.2.0" - }, - "properties": { - "appVersion": "2020-06-08T20:52:24Z", - "lastDraftVersion": "2020-06-08T20:52:24Z", - "lifeCycleId": "Published", - "status": "Ready", - "createdByClientVersion": { - "major": 3, - "minor": 18114, - "build": 26, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "minClientVersion": { - "major": 3, - "minor": 18114, - "build": 26, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "owner": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "createdBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastModifiedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastPublishedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "backgroundColor": "rgba(0, 176, 240, 1)", - "backgroundImageUri": "https://pafeblobprodln.blob.core.windows.net:443/20200608t000000z1cbf48a3f3b54583b8932510cbdf20b0/6342866521103212774/N90efe94c-af45-4639-885e-d69f32cd6c9f-logoSmallFile?sv=2018-03-28&sr=c&sig=mm7Cj0z%2FlX42FaSCSA9MtwBxMVEEnveqb1%2FsQhfLsRw%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "displayName": "Toolkit", - "description": "", - "appUris": { - "documentUri": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200608t000000z1cbf48a3f3b54583b8932510cbdf20b0/6342866521103212774/N1bc8ee4e-1a31-4917-86f8-b9309667d09b-document.msapp?sv=2018-03-28&sr=c&sig=vcph4RCCqlB6Hc78oScTcfdkMfj6dMggsvPxxqrBVpU%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200608t000000z1cbf48a3f3b54583b8932510cbdf20b0/6342866521103212774/N1bc8ee4e-1a31-4917-86f8-b9309667d09b-document.msapp?sv=2018-03-28&sr=c&sig=vcph4RCCqlB6Hc78oScTcfdkMfj6dMggsvPxxqrBVpU%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" - }, - "imageUris": [] - }, - "createdTime": "2020-06-08T20:52:24.1796831Z", - "lastModifiedTime": "2020-06-08T20:52:24.4140538Z", - "lastPublishTime": "2020-06-08T20:52:24Z", - "sharedGroupsCount": 0, - "sharedUsersCount": 0, - "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/79506a60-9c4c-4798-a1fa-aea552ef046e", - "appOpenUri": "https://apps.powerapps.com/play/79506a60-9c4c-4798-a1fa-aea552ef046e?tenantId=e8954f17-a373-4b61-b54d-45c038fe3188", - "databaseReferences": {}, - "userAppMetadata": { - "favorite": "NotSpecified", - "includeInAppsList": true - }, - "isFeaturedApp": false, - "bypassConsent": false, - "isHeroApp": false, - "environment": { - "id": "/providers/Microsoft.PowerApps/environments/Default-e8954f17-a373-4b61-b54d-45c038fe3188", - "name": "Default-e8954f17-a373-4b61-b54d-45c038fe3188" - }, - "almMode": "Environment", - "appPlanClassification": "Standard", - "usesPremiumApi": false, - "usesOnlyGrandfatheredPremiumApis": true, - "usesCustomApi": false, - "usesOnPremiseGateway": false - }, - "appType": "ClassicCanvasApp" - }, - { - "name": "f581c872-9852-4100-8e25-3d6891595204", - "id": "/providers/Microsoft.PowerApps/apps/f581c872-9852-4100-8e25-3d6891595204", - "type": "Microsoft.PowerApps/apps", - "tags": { - "primaryDeviceWidth": "640", - "primaryDeviceHeight": "1136", - "sienaVersion": "20200812T204016Z-3.20074.20.0", - "deviceCapabilities": "", - "supportsPortrait": "true", - "supportsLandscape": "false", - "primaryFormFactor": "Phone", - "publisherVersion": "3.20074.20", - "minimumRequiredApiVersion": "2.2.0", - "hasComponent": "false", - "hasUnlockedComponent": "false", - "isUnifiedRootApp": "false" - }, - "properties": { - "appVersion": "2020-08-12T20:40:16Z", - "lastDraftVersion": "2020-08-12T20:40:16Z", - "lifeCycleId": "Published", - "status": "Ready", - "createdByClientVersion": { - "major": 3, - "minor": 20074, - "build": 20, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "minClientVersion": { - "major": 3, - "minor": 20074, - "build": 20, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "owner": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "createdBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastModifiedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastPublishedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "backgroundColor": "rgba(0, 176, 240, 1)", - "backgroundImageUri": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z1766ec3fd78941bea695c957e898a62a/logoSmallFile?sv=2018-03-28&sr=c&sig=sqK6%2FXY4cHidwE%2Brb3JoBV3bNToOaA6EM3%2FczbWMQDc%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "teamsColorIconUrl": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/teamsColorIcon.png?sv=2018-03-28&sr=c&sig=UYs6LV%2BGqPjfNczXP80lm%2BmG1ebFNcLCF0D8MIJ6Lt8%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "teamsOutlineIconUrl": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/teamsOutlineIcon.png?sv=2018-03-28&sr=c&sig=UYs6LV%2BGqPjfNczXP80lm%2BmG1ebFNcLCF0D8MIJ6Lt8%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "displayName": "Playwright", - "description": "", - "commitMessage": "", - "appUris": { - "documentUri": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z1766ec3fd78941bea695c957e898a62a/document.msapp?sv=2018-03-28&sr=c&sig=aToV3yl8gK0eiAPsh3DIxo3VC77OyLrZgYo2G%2BYXDgI%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z1766ec3fd78941bea695c957e898a62a/document.msapp?sv=2018-03-28&sr=c&sig=aToV3yl8gK0eiAPsh3DIxo3VC77OyLrZgYo2G%2BYXDgI%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" - }, - "imageUris": [] - }, - "createdTime": "2020-08-10T23:28:41.8191546Z", - "lastModifiedTime": "2020-08-12T20:40:20.3706202Z", - "lastPublishTime": "2020-08-12T20:40:20.3706202Z", - "sharedGroupsCount": 0, - "sharedUsersCount": 0, - "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/f581c872-9852-4100-8e25-3d6891595204", - "appOpenUri": "https://apps.powerapps.com/play/f581c872-9852-4100-8e25-3d6891595204?tenantId=e8954f17-a373-4b61-b54d-45c038fe3188", - "connectionReferences": { - "dd1ebcc1-9930-4e87-a680-45fb1eaf94e6": { - "id": "/providers/microsoft.powerapps/apis/shared_office365users", - "displayName": "Office 365 Users", - "iconUri": "https://connectoricons-prod.azureedge.net/releases/v1.0.1381/1.0.1381.2096/office365users/icon.png", - "dataSources": [ - "Office365Users" - ], - "dependencies": [], - "dependents": [], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": {}, - "apiTier": "Standard", - "isCustomApiConnection": false - } - }, - "userAppMetadata": { - "favorite": "NotSpecified", - "lastOpenedTime": "2020-08-13T23:26:44.2982102Z", - "includeInAppsList": true - }, - "isFeaturedApp": false, - "bypassConsent": false, - "isHeroApp": false, - "environment": { - "id": "/providers/Microsoft.PowerApps/environments/Default-e8954f17-a373-4b61-b54d-45c038fe3188", - "name": "Default-e8954f17-a373-4b61-b54d-45c038fe3188" - }, - "appPackageDetails": { - "playerPackage": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/player.msappk?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/player.msappk?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "sizeInBytes": 0 - }, - "webPackage": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/web/index.web.html?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/web/index.web.html?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" - }, - "unauthenticatedWebPackage": { - "value": "https://pafeblobprodln.blob.core.windows.net/alt20200810t000000zc57cd52652b24a1eb573f7b2a36a10a9/20200812T204028Z/index.web.html" - }, - "documentServerVersion": { - "major": 3, - "minor": 20074, - "build": 20, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "appPackageResourcesKind": "Split", - "packagePropertiesJson": "{\"cdnUrl\":\"https://content.powerapps.com/resource/app\",\"preLoadIdx\":\"https://content.powerapps.com/resource/app/4g3nunecadgk9/preloadindex.web.html\",\"id\":\"637328616254057865\",\"v\":2.1}" - }, - "almMode": "Environment", - "performanceOptimizationEnabled": true, - "unauthenticatedWebPackageHint": "1eef5df9-6032-459c-9194-77d926b11f37", - "canConsumeAppPass": true, - "appPlanClassification": "Standard", - "usesPremiumApi": false, - "usesOnlyGrandfatheredPremiumApis": true, - "usesCustomApi": false, - "usesOnPremiseGateway": false - }, - "isAppComponentLibrary": false, - "appType": "ClassicCanvasApp" - } - ]; - sinon.stub(cli, 'executeCommandWithOutput').callsFake(async (command): Promise => { if (command === paAppListCommand) { return { "stdout": JSON.stringify(apps) }; @@ -643,641 +647,10 @@ describe(commands.APP_GET, () => { }); await command.action(logger, { options: { displayName: 'Playwright' } }); - assert(loggerLogSpy.calledWith( - { - "name": "f581c872-9852-4100-8e25-3d6891595204", - "id": "/providers/Microsoft.PowerApps/apps/f581c872-9852-4100-8e25-3d6891595204", - "type": "Microsoft.PowerApps/apps", - "tags": { - "primaryDeviceWidth": "640", - "primaryDeviceHeight": "1136", - "sienaVersion": "20200812T204016Z-3.20074.20.0", - "deviceCapabilities": "", - "supportsPortrait": "true", - "supportsLandscape": "false", - "primaryFormFactor": "Phone", - "publisherVersion": "3.20074.20", - "minimumRequiredApiVersion": "2.2.0", - "hasComponent": "false", - "hasUnlockedComponent": "false", - "isUnifiedRootApp": "false" - }, - "properties": { - "appVersion": "2020-08-12T20:40:16Z", - "lastDraftVersion": "2020-08-12T20:40:16Z", - "lifeCycleId": "Published", - "status": "Ready", - "createdByClientVersion": { - "major": 3, - "minor": 20074, - "build": 20, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "minClientVersion": { - "major": 3, - "minor": 20074, - "build": 20, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "owner": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "createdBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastModifiedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastPublishedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "backgroundColor": "rgba(0, 176, 240, 1)", - "backgroundImageUri": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z1766ec3fd78941bea695c957e898a62a/logoSmallFile?sv=2018-03-28&sr=c&sig=sqK6%2FXY4cHidwE%2Brb3JoBV3bNToOaA6EM3%2FczbWMQDc%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "teamsColorIconUrl": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/teamsColorIcon.png?sv=2018-03-28&sr=c&sig=UYs6LV%2BGqPjfNczXP80lm%2BmG1ebFNcLCF0D8MIJ6Lt8%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "teamsOutlineIconUrl": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/teamsOutlineIcon.png?sv=2018-03-28&sr=c&sig=UYs6LV%2BGqPjfNczXP80lm%2BmG1ebFNcLCF0D8MIJ6Lt8%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "displayName": "Playwright", - "description": "", - "commitMessage": "", - "appUris": { - "documentUri": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z1766ec3fd78941bea695c957e898a62a/document.msapp?sv=2018-03-28&sr=c&sig=aToV3yl8gK0eiAPsh3DIxo3VC77OyLrZgYo2G%2BYXDgI%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z1766ec3fd78941bea695c957e898a62a/document.msapp?sv=2018-03-28&sr=c&sig=aToV3yl8gK0eiAPsh3DIxo3VC77OyLrZgYo2G%2BYXDgI%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" - }, - "imageUris": [] - }, - "createdTime": "2020-08-10T23:28:41.8191546Z", - "lastModifiedTime": "2020-08-12T20:40:20.3706202Z", - "lastPublishTime": "2020-08-12T20:40:20.3706202Z", - "sharedGroupsCount": 0, - "sharedUsersCount": 0, - "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/f581c872-9852-4100-8e25-3d6891595204", - "appOpenUri": "https://apps.powerapps.com/play/f581c872-9852-4100-8e25-3d6891595204?tenantId=e8954f17-a373-4b61-b54d-45c038fe3188", - "connectionReferences": { - "dd1ebcc1-9930-4e87-a680-45fb1eaf94e6": { - "id": "/providers/microsoft.powerapps/apis/shared_office365users", - "displayName": "Office 365 Users", - "iconUri": "https://connectoricons-prod.azureedge.net/releases/v1.0.1381/1.0.1381.2096/office365users/icon.png", - "dataSources": [ - "Office365Users" - ], - "dependencies": [], - "dependents": [], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": {}, - "apiTier": "Standard", - "isCustomApiConnection": false - } - }, - "userAppMetadata": { - "favorite": "NotSpecified", - "lastOpenedTime": "2020-08-13T23:26:44.2982102Z", - "includeInAppsList": true - }, - "isFeaturedApp": false, - "bypassConsent": false, - "isHeroApp": false, - "environment": { - "id": "/providers/Microsoft.PowerApps/environments/Default-e8954f17-a373-4b61-b54d-45c038fe3188", - "name": "Default-e8954f17-a373-4b61-b54d-45c038fe3188" - }, - "appPackageDetails": { - "playerPackage": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/player.msappk?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/player.msappk?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "sizeInBytes": 0 - }, - "webPackage": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/web/index.web.html?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/web/index.web.html?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" - }, - "unauthenticatedWebPackage": { - "value": "https://pafeblobprodln.blob.core.windows.net/alt20200810t000000zc57cd52652b24a1eb573f7b2a36a10a9/20200812T204028Z/index.web.html" - }, - "documentServerVersion": { - "major": 3, - "minor": 20074, - "build": 20, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "appPackageResourcesKind": "Split", - "packagePropertiesJson": "{\"cdnUrl\":\"https://content.powerapps.com/resource/app\",\"preLoadIdx\":\"https://content.powerapps.com/resource/app/4g3nunecadgk9/preloadindex.web.html\",\"id\":\"637328616254057865\",\"v\":2.1}" - }, - "almMode": "Environment", - "performanceOptimizationEnabled": true, - "unauthenticatedWebPackageHint": "1eef5df9-6032-459c-9194-77d926b11f37", - "canConsumeAppPass": true, - "appPlanClassification": "Standard", - "usesPremiumApi": false, - "usesOnlyGrandfatheredPremiumApis": true, - "usesCustomApi": false, - "usesOnPremiseGateway": false - }, - "isAppComponentLibrary": false, - "appType": "ClassicCanvasApp", - "displayName": "Playwright", - "description": "", - "appVersion": "2020-08-12T20:40:16Z", - "owner": "john.doe@contoso.onmicrosoft.com" - } - )); + assert(loggerLogSpy.calledWith(apps[2])); }); it('retrieves information about the specified app using displayName as admin', async () => { - const apps = [ - { - "name": "4d4bb961-eef9-4258-8516-aa8d64e6b477", - "id": "/providers/Microsoft.PowerApps/apps/4d4bb961-eef9-4258-8516-aa8d64e6b477", - "type": "Microsoft.PowerApps/apps", - "tags": { - "primaryDeviceWidth": "1366", - "primaryDeviceHeight": "768", - "sienaVersion": "20200512T062535Z-3.20023.8.0", - "deviceCapabilities": "", - "supportsPortrait": "false", - "supportsLandscape": "true", - "primaryFormFactor": "Tablet", - "publisherVersion": "3.20023.8", - "minimumRequiredApiVersion": "2.2.0", - "hasComponent": "false", - "hasUnlockedComponent": "false" - }, - "properties": { - "appVersion": "2020-07-08T12:28:37Z", - "lastDraftVersion": "2020-07-08T12:28:37Z", - "lifeCycleId": "Published", - "status": "Ready", - "createdByClientVersion": { - "major": 3, - "minor": 20023, - "build": 8, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "minClientVersion": { - "major": 3, - "minor": 20023, - "build": 8, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "owner": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "createdBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastModifiedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastPublishedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "backgroundColor": "rgba(37, 62, 143, 1)", - "backgroundImageUri": "https://pafeblobprodln.blob.core.windows.net:443/20200708t000000z4d9d5509e6c745d3bbd4d6d317890ccd/13103204444004720806/N0eb33631-4950-45e8-b569-8ba8611af629-logoSmallFile?sv=2018-03-28&sr=c&sig=rTJyePWWDMM6mvIhZaOkRsEdLxFE4X6UGXjrqrz3iYo%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "displayName": "Request-a-team", - "description": "", - "commitMessage": "", - "appUris": { - "documentUri": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200708t000000z4d9d5509e6c745d3bbd4d6d317890ccd/13103204444004720806/N9d70c8fe-cbc0-4226-8818-372c4261e0c6-document.msapp?sv=2018-03-28&sr=c&sig=ltod6hA3brZQF9qTxNKFg0ryuX7IxsrJLY8KdA9u8f8%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200708t000000z4d9d5509e6c745d3bbd4d6d317890ccd/13103204444004720806/N9d70c8fe-cbc0-4226-8818-372c4261e0c6-document.msapp?sv=2018-03-28&sr=c&sig=ltod6hA3brZQF9qTxNKFg0ryuX7IxsrJLY8KdA9u8f8%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" - }, - "imageUris": [] - }, - "createdTime": "2020-07-08T12:28:37.957179Z", - "lastModifiedTime": "2020-07-08T12:28:38.7556554Z", - "lastPublishTime": "2020-07-08T12:28:37Z", - "sharedGroupsCount": 0, - "sharedUsersCount": 0, - "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/4d4bb961-eef9-4258-8516-aa8d64e6b477", - "appOpenUri": "https://apps.powerapps.com/play/4d4bb961-eef9-4258-8516-aa8d64e6b477?tenantId=e8954f17-a373-4b61-b54d-45c038fe3188", - "connectionReferences": { - "9d5036a3-8b23-4125-a5cc-7dc0dbb2f8cb": { - "id": "/providers/microsoft.powerapps/apis/shared_office365users", - "displayName": "Office 365 Users", - "iconUri": "https://connectoricons-prod.azureedge.net/office365users/icon_1.0.1357.2029.png", - "dataSources": [ - "Office365Users" - ], - "dependencies": [], - "dependents": [], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": {}, - "apiTier": "Standard", - "isCustomApiConnection": false - }, - "a65df3f8-e66c-4cbd-b13f-458b7e96f677": { - "id": "/providers/microsoft.powerapps/apis/shared_office365groups", - "displayName": "Office 365 Groups", - "iconUri": "https://connectoricons-prod.azureedge.net/office365groups/icon_1.0.1329.1953.png", - "dataSources": [ - "Office365Groups" - ], - "dependencies": [], - "dependents": [], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": {}, - "apiTier": "Standard", - "isCustomApiConnection": false - }, - "041cbeda-55ca-4c48-b8e3-03928fb72bb2": { - "id": "/providers/microsoft.powerapps/apis/shared_logicflows", - "displayName": "Logic flows", - "iconUri": "https://resourcestackdeploy.blob.core.windows.net/scripts/13276078.png", - "dataSources": [ - "CheckTeamAvailability" - ], - "dependencies": [ - "97e5ce6b-9f9a-4186-885f-9b5d6476c732" - ], - "dependents": [], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": {}, - "apiTier": "Standard", - "isCustomApiConnection": false - }, - "97e5ce6b-9f9a-4186-885f-9b5d6476c732": { - "id": "/providers/microsoft.powerapps/apis/shared_sharepointonline", - "displayName": "SharePoint", - "iconUri": "https://connectoricons-prod.azureedge.net/sharepointonline/icon_1.0.1363.2042.png", - "dataSources": [], - "dependencies": [], - "dependents": [ - "041cbeda-55ca-4c48-b8e3-03928fb72bb2" - ], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": {}, - "apiTier": "Standard", - "isCustomApiConnection": false - }, - "00deca03-387b-4ad4-bbd4-cefc640d1c9b": { - "id": "/providers/microsoft.powerapps/apis/shared_sharepointonline", - "displayName": "SharePoint", - "iconUri": "https://connectoricons-prod.azureedge.net/sharepointonline/icon_1.0.1363.2042.png", - "dataSources": [ - "Teams Templates", - "Teams Requests", - "Team Request Settings" - ], - "dependencies": [], - "dependents": [], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": { - "https://contoso.sharepoint.com/sites/RequestateamApp": { - "dataSources": { - "Teams Templates": { - "tableName": "298485ad-73cc-4b5f-a013-b56111ec351a" - }, - "Teams Requests": { - "tableName": "a471ecf0-01f3-4e3e-902b-b48daaa23aba" - }, - "Team Request Settings": { - "tableName": "3770cede-bff2-42a6-ba12-2f4cbccb90d3" - } - } - } - }, - "apiTier": "Standard", - "isCustomApiConnection": false - } - }, - "databaseReferences": {}, - "userAppMetadata": { - "favorite": "NotSpecified", - "includeInAppsList": true - }, - "isFeaturedApp": false, - "bypassConsent": false, - "isHeroApp": false, - "environment": { - "id": "/providers/Microsoft.PowerApps/environments/Default-e8954f17-a373-4b61-b54d-45c038fe3188", - "name": "Default-e8954f17-a373-4b61-b54d-45c038fe3188" - }, - "almMode": "Environment", - "performanceOptimizationEnabled": false, - "canConsumeAppPass": true, - "appPlanClassification": "Standard", - "usesPremiumApi": false, - "usesOnlyGrandfatheredPremiumApis": true, - "usesCustomApi": false, - "usesOnPremiseGateway": false - }, - "isAppComponentLibrary": false, - "appType": "ClassicCanvasApp" - }, - { - "name": "79506a60-9c4c-4798-a1fa-aea552ef046e", - "id": "/providers/Microsoft.PowerApps/apps/79506a60-9c4c-4798-a1fa-aea552ef046e", - "type": "Microsoft.PowerApps/apps", - "tags": { - "minimumRequiredApiVersion": "2.2.0" - }, - "properties": { - "appVersion": "2020-06-08T20:52:24Z", - "lastDraftVersion": "2020-06-08T20:52:24Z", - "lifeCycleId": "Published", - "status": "Ready", - "createdByClientVersion": { - "major": 3, - "minor": 18114, - "build": 26, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "minClientVersion": { - "major": 3, - "minor": 18114, - "build": 26, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "owner": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "createdBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastModifiedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastPublishedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "backgroundColor": "rgba(0, 176, 240, 1)", - "backgroundImageUri": "https://pafeblobprodln.blob.core.windows.net:443/20200608t000000z1cbf48a3f3b54583b8932510cbdf20b0/6342866521103212774/N90efe94c-af45-4639-885e-d69f32cd6c9f-logoSmallFile?sv=2018-03-28&sr=c&sig=mm7Cj0z%2FlX42FaSCSA9MtwBxMVEEnveqb1%2FsQhfLsRw%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "displayName": "Toolkit", - "description": "", - "appUris": { - "documentUri": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200608t000000z1cbf48a3f3b54583b8932510cbdf20b0/6342866521103212774/N1bc8ee4e-1a31-4917-86f8-b9309667d09b-document.msapp?sv=2018-03-28&sr=c&sig=vcph4RCCqlB6Hc78oScTcfdkMfj6dMggsvPxxqrBVpU%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200608t000000z1cbf48a3f3b54583b8932510cbdf20b0/6342866521103212774/N1bc8ee4e-1a31-4917-86f8-b9309667d09b-document.msapp?sv=2018-03-28&sr=c&sig=vcph4RCCqlB6Hc78oScTcfdkMfj6dMggsvPxxqrBVpU%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" - }, - "imageUris": [] - }, - "createdTime": "2020-06-08T20:52:24.1796831Z", - "lastModifiedTime": "2020-06-08T20:52:24.4140538Z", - "lastPublishTime": "2020-06-08T20:52:24Z", - "sharedGroupsCount": 0, - "sharedUsersCount": 0, - "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/79506a60-9c4c-4798-a1fa-aea552ef046e", - "appOpenUri": "https://apps.powerapps.com/play/79506a60-9c4c-4798-a1fa-aea552ef046e?tenantId=e8954f17-a373-4b61-b54d-45c038fe3188", - "databaseReferences": {}, - "userAppMetadata": { - "favorite": "NotSpecified", - "includeInAppsList": true - }, - "isFeaturedApp": false, - "bypassConsent": false, - "isHeroApp": false, - "environment": { - "id": "/providers/Microsoft.PowerApps/environments/Default-e8954f17-a373-4b61-b54d-45c038fe3188", - "name": "Default-e8954f17-a373-4b61-b54d-45c038fe3188" - }, - "almMode": "Environment", - "appPlanClassification": "Standard", - "usesPremiumApi": false, - "usesOnlyGrandfatheredPremiumApis": true, - "usesCustomApi": false, - "usesOnPremiseGateway": false - }, - "appType": "ClassicCanvasApp" - }, - { - "name": "f581c872-9852-4100-8e25-3d6891595204", - "id": "/providers/Microsoft.PowerApps/apps/f581c872-9852-4100-8e25-3d6891595204", - "type": "Microsoft.PowerApps/apps", - "tags": { - "primaryDeviceWidth": "640", - "primaryDeviceHeight": "1136", - "sienaVersion": "20200812T204016Z-3.20074.20.0", - "deviceCapabilities": "", - "supportsPortrait": "true", - "supportsLandscape": "false", - "primaryFormFactor": "Phone", - "publisherVersion": "3.20074.20", - "minimumRequiredApiVersion": "2.2.0", - "hasComponent": "false", - "hasUnlockedComponent": "false", - "isUnifiedRootApp": "false" - }, - "properties": { - "appVersion": "2020-08-12T20:40:16Z", - "lastDraftVersion": "2020-08-12T20:40:16Z", - "lifeCycleId": "Published", - "status": "Ready", - "createdByClientVersion": { - "major": 3, - "minor": 20074, - "build": 20, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "minClientVersion": { - "major": 3, - "minor": 20074, - "build": 20, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "owner": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "createdBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastModifiedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastPublishedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "backgroundColor": "rgba(0, 176, 240, 1)", - "backgroundImageUri": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z1766ec3fd78941bea695c957e898a62a/logoSmallFile?sv=2018-03-28&sr=c&sig=sqK6%2FXY4cHidwE%2Brb3JoBV3bNToOaA6EM3%2FczbWMQDc%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "teamsColorIconUrl": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/teamsColorIcon.png?sv=2018-03-28&sr=c&sig=UYs6LV%2BGqPjfNczXP80lm%2BmG1ebFNcLCF0D8MIJ6Lt8%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "teamsOutlineIconUrl": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/teamsOutlineIcon.png?sv=2018-03-28&sr=c&sig=UYs6LV%2BGqPjfNczXP80lm%2BmG1ebFNcLCF0D8MIJ6Lt8%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "displayName": "Playwright", - "description": "", - "commitMessage": "", - "appUris": { - "documentUri": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z1766ec3fd78941bea695c957e898a62a/document.msapp?sv=2018-03-28&sr=c&sig=aToV3yl8gK0eiAPsh3DIxo3VC77OyLrZgYo2G%2BYXDgI%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z1766ec3fd78941bea695c957e898a62a/document.msapp?sv=2018-03-28&sr=c&sig=aToV3yl8gK0eiAPsh3DIxo3VC77OyLrZgYo2G%2BYXDgI%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" - }, - "imageUris": [] - }, - "createdTime": "2020-08-10T23:28:41.8191546Z", - "lastModifiedTime": "2020-08-12T20:40:20.3706202Z", - "lastPublishTime": "2020-08-12T20:40:20.3706202Z", - "sharedGroupsCount": 0, - "sharedUsersCount": 0, - "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/f581c872-9852-4100-8e25-3d6891595204", - "appOpenUri": "https://apps.powerapps.com/play/f581c872-9852-4100-8e25-3d6891595204?tenantId=e8954f17-a373-4b61-b54d-45c038fe3188", - "connectionReferences": { - "dd1ebcc1-9930-4e87-a680-45fb1eaf94e6": { - "id": "/providers/microsoft.powerapps/apis/shared_office365users", - "displayName": "Office 365 Users", - "iconUri": "https://connectoricons-prod.azureedge.net/releases/v1.0.1381/1.0.1381.2096/office365users/icon.png", - "dataSources": [ - "Office365Users" - ], - "dependencies": [], - "dependents": [], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": {}, - "apiTier": "Standard", - "isCustomApiConnection": false - } - }, - "userAppMetadata": { - "favorite": "NotSpecified", - "lastOpenedTime": "2020-08-13T23:26:44.2982102Z", - "includeInAppsList": true - }, - "isFeaturedApp": false, - "bypassConsent": false, - "isHeroApp": false, - "environment": { - "id": "/providers/Microsoft.PowerApps/environments/Default-e8954f17-a373-4b61-b54d-45c038fe3188", - "name": "Default-e8954f17-a373-4b61-b54d-45c038fe3188" - }, - "appPackageDetails": { - "playerPackage": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/player.msappk?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/player.msappk?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "sizeInBytes": 0 - }, - "webPackage": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/web/index.web.html?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/web/index.web.html?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" - }, - "unauthenticatedWebPackage": { - "value": "https://pafeblobprodln.blob.core.windows.net/alt20200810t000000zc57cd52652b24a1eb573f7b2a36a10a9/20200812T204028Z/index.web.html" - }, - "documentServerVersion": { - "major": 3, - "minor": 20074, - "build": 20, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "appPackageResourcesKind": "Split", - "packagePropertiesJson": "{\"cdnUrl\":\"https://content.powerapps.com/resource/app\",\"preLoadIdx\":\"https://content.powerapps.com/resource/app/4g3nunecadgk9/preloadindex.web.html\",\"id\":\"637328616254057865\",\"v\":2.1}" - }, - "almMode": "Environment", - "performanceOptimizationEnabled": true, - "unauthenticatedWebPackageHint": "1eef5df9-6032-459c-9194-77d926b11f37", - "canConsumeAppPass": true, - "appPlanClassification": "Standard", - "usesPremiumApi": false, - "usesOnlyGrandfatheredPremiumApis": true, - "usesCustomApi": false, - "usesOnPremiseGateway": false - }, - "isAppComponentLibrary": false, - "appType": "ClassicCanvasApp" - } - ]; - sinon.stub(cli, 'executeCommandWithOutput').callsFake(async (command, args): Promise => { if (command === paAppListCommand && args.options.environmentName === '4ce50206-9576-4237-8b17-38d8aadfaa35' && args.options.asAdmin) { return { "stdout": JSON.stringify(apps) }; @@ -1286,170 +659,7 @@ describe(commands.APP_GET, () => { }); await command.action(logger, { options: { displayName: 'Playwright', environmentName: '4ce50206-9576-4237-8b17-38d8aadfaa35', asAdmin: true } }); - assert(loggerLogSpy.calledWith( - { - "name": "f581c872-9852-4100-8e25-3d6891595204", - "id": "/providers/Microsoft.PowerApps/apps/f581c872-9852-4100-8e25-3d6891595204", - "type": "Microsoft.PowerApps/apps", - "tags": { - "primaryDeviceWidth": "640", - "primaryDeviceHeight": "1136", - "sienaVersion": "20200812T204016Z-3.20074.20.0", - "deviceCapabilities": "", - "supportsPortrait": "true", - "supportsLandscape": "false", - "primaryFormFactor": "Phone", - "publisherVersion": "3.20074.20", - "minimumRequiredApiVersion": "2.2.0", - "hasComponent": "false", - "hasUnlockedComponent": "false", - "isUnifiedRootApp": "false" - }, - "properties": { - "appVersion": "2020-08-12T20:40:16Z", - "lastDraftVersion": "2020-08-12T20:40:16Z", - "lifeCycleId": "Published", - "status": "Ready", - "createdByClientVersion": { - "major": 3, - "minor": 20074, - "build": 20, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "minClientVersion": { - "major": 3, - "minor": 20074, - "build": 20, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "owner": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "createdBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastModifiedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastPublishedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "backgroundColor": "rgba(0, 176, 240, 1)", - "backgroundImageUri": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z1766ec3fd78941bea695c957e898a62a/logoSmallFile?sv=2018-03-28&sr=c&sig=sqK6%2FXY4cHidwE%2Brb3JoBV3bNToOaA6EM3%2FczbWMQDc%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "teamsColorIconUrl": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/teamsColorIcon.png?sv=2018-03-28&sr=c&sig=UYs6LV%2BGqPjfNczXP80lm%2BmG1ebFNcLCF0D8MIJ6Lt8%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "teamsOutlineIconUrl": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/teamsOutlineIcon.png?sv=2018-03-28&sr=c&sig=UYs6LV%2BGqPjfNczXP80lm%2BmG1ebFNcLCF0D8MIJ6Lt8%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "displayName": "Playwright", - "description": "", - "commitMessage": "", - "appUris": { - "documentUri": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z1766ec3fd78941bea695c957e898a62a/document.msapp?sv=2018-03-28&sr=c&sig=aToV3yl8gK0eiAPsh3DIxo3VC77OyLrZgYo2G%2BYXDgI%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z1766ec3fd78941bea695c957e898a62a/document.msapp?sv=2018-03-28&sr=c&sig=aToV3yl8gK0eiAPsh3DIxo3VC77OyLrZgYo2G%2BYXDgI%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" - }, - "imageUris": [] - }, - "createdTime": "2020-08-10T23:28:41.8191546Z", - "lastModifiedTime": "2020-08-12T20:40:20.3706202Z", - "lastPublishTime": "2020-08-12T20:40:20.3706202Z", - "sharedGroupsCount": 0, - "sharedUsersCount": 0, - "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/f581c872-9852-4100-8e25-3d6891595204", - "appOpenUri": "https://apps.powerapps.com/play/f581c872-9852-4100-8e25-3d6891595204?tenantId=e8954f17-a373-4b61-b54d-45c038fe3188", - "connectionReferences": { - "dd1ebcc1-9930-4e87-a680-45fb1eaf94e6": { - "id": "/providers/microsoft.powerapps/apis/shared_office365users", - "displayName": "Office 365 Users", - "iconUri": "https://connectoricons-prod.azureedge.net/releases/v1.0.1381/1.0.1381.2096/office365users/icon.png", - "dataSources": [ - "Office365Users" - ], - "dependencies": [], - "dependents": [], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": {}, - "apiTier": "Standard", - "isCustomApiConnection": false - } - }, - "userAppMetadata": { - "favorite": "NotSpecified", - "lastOpenedTime": "2020-08-13T23:26:44.2982102Z", - "includeInAppsList": true - }, - "isFeaturedApp": false, - "bypassConsent": false, - "isHeroApp": false, - "environment": { - "id": "/providers/Microsoft.PowerApps/environments/Default-e8954f17-a373-4b61-b54d-45c038fe3188", - "name": "Default-e8954f17-a373-4b61-b54d-45c038fe3188" - }, - "appPackageDetails": { - "playerPackage": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/player.msappk?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/player.msappk?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "sizeInBytes": 0 - }, - "webPackage": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/web/index.web.html?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/web/index.web.html?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" - }, - "unauthenticatedWebPackage": { - "value": "https://pafeblobprodln.blob.core.windows.net/alt20200810t000000zc57cd52652b24a1eb573f7b2a36a10a9/20200812T204028Z/index.web.html" - }, - "documentServerVersion": { - "major": 3, - "minor": 20074, - "build": 20, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "appPackageResourcesKind": "Split", - "packagePropertiesJson": "{\"cdnUrl\":\"https://content.powerapps.com/resource/app\",\"preLoadIdx\":\"https://content.powerapps.com/resource/app/4g3nunecadgk9/preloadindex.web.html\",\"id\":\"637328616254057865\",\"v\":2.1}" - }, - "almMode": "Environment", - "performanceOptimizationEnabled": true, - "unauthenticatedWebPackageHint": "1eef5df9-6032-459c-9194-77d926b11f37", - "canConsumeAppPass": true, - "appPlanClassification": "Standard", - "usesPremiumApi": false, - "usesOnlyGrandfatheredPremiumApis": true, - "usesCustomApi": false, - "usesOnPremiseGateway": false - }, - "isAppComponentLibrary": false, - "appType": "ClassicCanvasApp", - "displayName": "Playwright", - "description": "", - "appVersion": "2020-08-12T20:40:16Z", - "owner": "john.doe@contoso.onmicrosoft.com" - } - )); + assert(loggerLogSpy.calledWith(apps[2])); }); it('renders empty string for missing properties using name', async () => { @@ -1470,474 +680,6 @@ describe(commands.APP_GET, () => { }); it('renders empty string for missing properties using displayName', async () => { - const apps = [ - { - "name": "4d4bb961-eef9-4258-8516-aa8d64e6b477", - "id": "/providers/Microsoft.PowerApps/apps/4d4bb961-eef9-4258-8516-aa8d64e6b477", - "type": "Microsoft.PowerApps/apps", - "tags": { - "primaryDeviceWidth": "1366", - "primaryDeviceHeight": "768", - "sienaVersion": "20200512T062535Z-3.20023.8.0", - "deviceCapabilities": "", - "supportsPortrait": "false", - "supportsLandscape": "true", - "primaryFormFactor": "Tablet", - "publisherVersion": "3.20023.8", - "minimumRequiredApiVersion": "2.2.0", - "hasComponent": "false", - "hasUnlockedComponent": "false" - }, - "properties": { - "appVersion": "2020-07-08T12:28:37Z", - "lastDraftVersion": "2020-07-08T12:28:37Z", - "lifeCycleId": "Published", - "status": "Ready", - "createdByClientVersion": { - "major": 3, - "minor": 20023, - "build": 8, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "minClientVersion": { - "major": 3, - "minor": 20023, - "build": 8, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "owner": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "createdBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastModifiedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastPublishedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "backgroundColor": "rgba(37, 62, 143, 1)", - "backgroundImageUri": "https://pafeblobprodln.blob.core.windows.net:443/20200708t000000z4d9d5509e6c745d3bbd4d6d317890ccd/13103204444004720806/N0eb33631-4950-45e8-b569-8ba8611af629-logoSmallFile?sv=2018-03-28&sr=c&sig=rTJyePWWDMM6mvIhZaOkRsEdLxFE4X6UGXjrqrz3iYo%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "displayName": "Request-a-team", - "description": "", - "commitMessage": "", - "appUris": { - "documentUri": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200708t000000z4d9d5509e6c745d3bbd4d6d317890ccd/13103204444004720806/N9d70c8fe-cbc0-4226-8818-372c4261e0c6-document.msapp?sv=2018-03-28&sr=c&sig=ltod6hA3brZQF9qTxNKFg0ryuX7IxsrJLY8KdA9u8f8%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200708t000000z4d9d5509e6c745d3bbd4d6d317890ccd/13103204444004720806/N9d70c8fe-cbc0-4226-8818-372c4261e0c6-document.msapp?sv=2018-03-28&sr=c&sig=ltod6hA3brZQF9qTxNKFg0ryuX7IxsrJLY8KdA9u8f8%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" - }, - "imageUris": [] - }, - "createdTime": "2020-07-08T12:28:37.957179Z", - "lastModifiedTime": "2020-07-08T12:28:38.7556554Z", - "lastPublishTime": "2020-07-08T12:28:37Z", - "sharedGroupsCount": 0, - "sharedUsersCount": 0, - "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/4d4bb961-eef9-4258-8516-aa8d64e6b477", - "appOpenUri": "https://apps.powerapps.com/play/4d4bb961-eef9-4258-8516-aa8d64e6b477?tenantId=e8954f17-a373-4b61-b54d-45c038fe3188", - "connectionReferences": { - "9d5036a3-8b23-4125-a5cc-7dc0dbb2f8cb": { - "id": "/providers/microsoft.powerapps/apis/shared_office365users", - "displayName": "Office 365 Users", - "iconUri": "https://connectoricons-prod.azureedge.net/office365users/icon_1.0.1357.2029.png", - "dataSources": [ - "Office365Users" - ], - "dependencies": [], - "dependents": [], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": {}, - "apiTier": "Standard", - "isCustomApiConnection": false - }, - "a65df3f8-e66c-4cbd-b13f-458b7e96f677": { - "id": "/providers/microsoft.powerapps/apis/shared_office365groups", - "displayName": "Office 365 Groups", - "iconUri": "https://connectoricons-prod.azureedge.net/office365groups/icon_1.0.1329.1953.png", - "dataSources": [ - "Office365Groups" - ], - "dependencies": [], - "dependents": [], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": {}, - "apiTier": "Standard", - "isCustomApiConnection": false - }, - "041cbeda-55ca-4c48-b8e3-03928fb72bb2": { - "id": "/providers/microsoft.powerapps/apis/shared_logicflows", - "displayName": "Logic flows", - "iconUri": "https://resourcestackdeploy.blob.core.windows.net/scripts/13276078.png", - "dataSources": [ - "CheckTeamAvailability" - ], - "dependencies": [ - "97e5ce6b-9f9a-4186-885f-9b5d6476c732" - ], - "dependents": [], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": {}, - "apiTier": "Standard", - "isCustomApiConnection": false - }, - "97e5ce6b-9f9a-4186-885f-9b5d6476c732": { - "id": "/providers/microsoft.powerapps/apis/shared_sharepointonline", - "displayName": "SharePoint", - "iconUri": "https://connectoricons-prod.azureedge.net/sharepointonline/icon_1.0.1363.2042.png", - "dataSources": [], - "dependencies": [], - "dependents": [ - "041cbeda-55ca-4c48-b8e3-03928fb72bb2" - ], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": {}, - "apiTier": "Standard", - "isCustomApiConnection": false - }, - "00deca03-387b-4ad4-bbd4-cefc640d1c9b": { - "id": "/providers/microsoft.powerapps/apis/shared_sharepointonline", - "displayName": "SharePoint", - "iconUri": "https://connectoricons-prod.azureedge.net/sharepointonline/icon_1.0.1363.2042.png", - "dataSources": [ - "Teams Templates", - "Teams Requests", - "Team Request Settings" - ], - "dependencies": [], - "dependents": [], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": { - "https://contoso.sharepoint.com/sites/RequestateamApp": { - "dataSources": { - "Teams Templates": { - "tableName": "298485ad-73cc-4b5f-a013-b56111ec351a" - }, - "Teams Requests": { - "tableName": "a471ecf0-01f3-4e3e-902b-b48daaa23aba" - }, - "Team Request Settings": { - "tableName": "3770cede-bff2-42a6-ba12-2f4cbccb90d3" - } - } - } - }, - "apiTier": "Standard", - "isCustomApiConnection": false - } - }, - "databaseReferences": {}, - "userAppMetadata": { - "favorite": "NotSpecified", - "includeInAppsList": true - }, - "isFeaturedApp": false, - "bypassConsent": false, - "isHeroApp": false, - "environment": { - "id": "/providers/Microsoft.PowerApps/environments/Default-e8954f17-a373-4b61-b54d-45c038fe3188", - "name": "Default-e8954f17-a373-4b61-b54d-45c038fe3188" - }, - "almMode": "Environment", - "performanceOptimizationEnabled": false, - "canConsumeAppPass": true, - "appPlanClassification": "Standard", - "usesPremiumApi": false, - "usesOnlyGrandfatheredPremiumApis": true, - "usesCustomApi": false, - "usesOnPremiseGateway": false - }, - "isAppComponentLibrary": false, - "appType": "ClassicCanvasApp" - }, - { - "name": "79506a60-9c4c-4798-a1fa-aea552ef046e", - "id": "/providers/Microsoft.PowerApps/apps/79506a60-9c4c-4798-a1fa-aea552ef046e", - "type": "Microsoft.PowerApps/apps", - "tags": { - "minimumRequiredApiVersion": "2.2.0" - }, - "properties": { - "appVersion": "2020-06-08T20:52:24Z", - "lastDraftVersion": "2020-06-08T20:52:24Z", - "lifeCycleId": "Published", - "status": "Ready", - "createdByClientVersion": { - "major": 3, - "minor": 18114, - "build": 26, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "minClientVersion": { - "major": 3, - "minor": 18114, - "build": 26, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "owner": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "createdBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastModifiedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastPublishedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "backgroundColor": "rgba(0, 176, 240, 1)", - "backgroundImageUri": "https://pafeblobprodln.blob.core.windows.net:443/20200608t000000z1cbf48a3f3b54583b8932510cbdf20b0/6342866521103212774/N90efe94c-af45-4639-885e-d69f32cd6c9f-logoSmallFile?sv=2018-03-28&sr=c&sig=mm7Cj0z%2FlX42FaSCSA9MtwBxMVEEnveqb1%2FsQhfLsRw%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "displayName": "Toolkit", - "description": "", - "appUris": { - "documentUri": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200608t000000z1cbf48a3f3b54583b8932510cbdf20b0/6342866521103212774/N1bc8ee4e-1a31-4917-86f8-b9309667d09b-document.msapp?sv=2018-03-28&sr=c&sig=vcph4RCCqlB6Hc78oScTcfdkMfj6dMggsvPxxqrBVpU%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200608t000000z1cbf48a3f3b54583b8932510cbdf20b0/6342866521103212774/N1bc8ee4e-1a31-4917-86f8-b9309667d09b-document.msapp?sv=2018-03-28&sr=c&sig=vcph4RCCqlB6Hc78oScTcfdkMfj6dMggsvPxxqrBVpU%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" - }, - "imageUris": [] - }, - "createdTime": "2020-06-08T20:52:24.1796831Z", - "lastModifiedTime": "2020-06-08T20:52:24.4140538Z", - "lastPublishTime": "2020-06-08T20:52:24Z", - "sharedGroupsCount": 0, - "sharedUsersCount": 0, - "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/79506a60-9c4c-4798-a1fa-aea552ef046e", - "appOpenUri": "https://apps.powerapps.com/play/79506a60-9c4c-4798-a1fa-aea552ef046e?tenantId=e8954f17-a373-4b61-b54d-45c038fe3188", - "databaseReferences": {}, - "userAppMetadata": { - "favorite": "NotSpecified", - "includeInAppsList": true - }, - "isFeaturedApp": false, - "bypassConsent": false, - "isHeroApp": false, - "environment": { - "id": "/providers/Microsoft.PowerApps/environments/Default-e8954f17-a373-4b61-b54d-45c038fe3188", - "name": "Default-e8954f17-a373-4b61-b54d-45c038fe3188" - }, - "almMode": "Environment", - "appPlanClassification": "Standard", - "usesPremiumApi": false, - "usesOnlyGrandfatheredPremiumApis": true, - "usesCustomApi": false, - "usesOnPremiseGateway": false - }, - "appType": "ClassicCanvasApp" - }, - { - "name": "f581c872-9852-4100-8e25-3d6891595204", - "id": "/providers/Microsoft.PowerApps/apps/f581c872-9852-4100-8e25-3d6891595204", - "type": "Microsoft.PowerApps/apps", - "tags": { - "primaryDeviceWidth": "640", - "primaryDeviceHeight": "1136", - "sienaVersion": "20200812T204016Z-3.20074.20.0", - "deviceCapabilities": "", - "supportsPortrait": "true", - "supportsLandscape": "false", - "primaryFormFactor": "Phone", - "publisherVersion": "3.20074.20", - "minimumRequiredApiVersion": "2.2.0", - "hasComponent": "false", - "hasUnlockedComponent": "false", - "isUnifiedRootApp": "false" - }, - "properties": { - "appVersion": "2020-08-12T20:40:16Z", - "lastDraftVersion": "2020-08-12T20:40:16Z", - "lifeCycleId": "Published", - "status": "Ready", - "createdByClientVersion": { - "major": 3, - "minor": 20074, - "build": 20, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "minClientVersion": { - "major": 3, - "minor": 20074, - "build": 20, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "owner": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "createdBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastModifiedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastPublishedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "backgroundColor": "rgba(0, 176, 240, 1)", - "backgroundImageUri": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z1766ec3fd78941bea695c957e898a62a/logoSmallFile?sv=2018-03-28&sr=c&sig=sqK6%2FXY4cHidwE%2Brb3JoBV3bNToOaA6EM3%2FczbWMQDc%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "teamsColorIconUrl": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/teamsColorIcon.png?sv=2018-03-28&sr=c&sig=UYs6LV%2BGqPjfNczXP80lm%2BmG1ebFNcLCF0D8MIJ6Lt8%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "teamsOutlineIconUrl": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/teamsOutlineIcon.png?sv=2018-03-28&sr=c&sig=UYs6LV%2BGqPjfNczXP80lm%2BmG1ebFNcLCF0D8MIJ6Lt8%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "displayName": "Playwright", - "description": "", - "commitMessage": "", - "appUris": { - "documentUri": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z1766ec3fd78941bea695c957e898a62a/document.msapp?sv=2018-03-28&sr=c&sig=aToV3yl8gK0eiAPsh3DIxo3VC77OyLrZgYo2G%2BYXDgI%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z1766ec3fd78941bea695c957e898a62a/document.msapp?sv=2018-03-28&sr=c&sig=aToV3yl8gK0eiAPsh3DIxo3VC77OyLrZgYo2G%2BYXDgI%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" - }, - "imageUris": [] - }, - "createdTime": "2020-08-10T23:28:41.8191546Z", - "lastModifiedTime": "2020-08-12T20:40:20.3706202Z", - "lastPublishTime": "2020-08-12T20:40:20.3706202Z", - "sharedGroupsCount": 0, - "sharedUsersCount": 0, - "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/f581c872-9852-4100-8e25-3d6891595204", - "appOpenUri": "https://apps.powerapps.com/play/f581c872-9852-4100-8e25-3d6891595204?tenantId=e8954f17-a373-4b61-b54d-45c038fe3188", - "connectionReferences": { - "dd1ebcc1-9930-4e87-a680-45fb1eaf94e6": { - "id": "/providers/microsoft.powerapps/apis/shared_office365users", - "displayName": "Office 365 Users", - "iconUri": "https://connectoricons-prod.azureedge.net/releases/v1.0.1381/1.0.1381.2096/office365users/icon.png", - "dataSources": [ - "Office365Users" - ], - "dependencies": [], - "dependents": [], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": {}, - "apiTier": "Standard", - "isCustomApiConnection": false - } - }, - "userAppMetadata": { - "favorite": "NotSpecified", - "lastOpenedTime": "2020-08-13T23:26:44.2982102Z", - "includeInAppsList": true - }, - "isFeaturedApp": false, - "bypassConsent": false, - "isHeroApp": false, - "environment": { - "id": "/providers/Microsoft.PowerApps/environments/Default-e8954f17-a373-4b61-b54d-45c038fe3188", - "name": "Default-e8954f17-a373-4b61-b54d-45c038fe3188" - }, - "appPackageDetails": { - "playerPackage": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/player.msappk?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/player.msappk?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "sizeInBytes": 0 - }, - "webPackage": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/web/index.web.html?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/web/index.web.html?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" - }, - "unauthenticatedWebPackage": { - "value": "https://pafeblobprodln.blob.core.windows.net/alt20200810t000000zc57cd52652b24a1eb573f7b2a36a10a9/20200812T204028Z/index.web.html" - }, - "documentServerVersion": { - "major": 3, - "minor": 20074, - "build": 20, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "appPackageResourcesKind": "Split", - "packagePropertiesJson": "{\"cdnUrl\":\"https://content.powerapps.com/resource/app\",\"preLoadIdx\":\"https://content.powerapps.com/resource/app/4g3nunecadgk9/preloadindex.web.html\",\"id\":\"637328616254057865\",\"v\":2.1}" - }, - "almMode": "Environment", - "performanceOptimizationEnabled": true, - "unauthenticatedWebPackageHint": "1eef5df9-6032-459c-9194-77d926b11f37", - "canConsumeAppPass": true, - "appPlanClassification": "Standard", - "usesPremiumApi": false, - "usesOnlyGrandfatheredPremiumApis": true, - "usesCustomApi": false, - "usesOnPremiseGateway": false - }, - "isAppComponentLibrary": false, - "appType": "ClassicCanvasApp" - } - ]; - sinon.stub(cli, 'executeCommandWithOutput').callsFake(async (command): Promise => { if (command === paAppListCommand) { return { "stdout": JSON.stringify(apps) }; @@ -1946,170 +688,7 @@ describe(commands.APP_GET, () => { }); await command.action(logger, { options: { displayName: 'Playwright' } }); - assert(loggerLogSpy.calledWith( - { - "name": "f581c872-9852-4100-8e25-3d6891595204", - "id": "/providers/Microsoft.PowerApps/apps/f581c872-9852-4100-8e25-3d6891595204", - "type": "Microsoft.PowerApps/apps", - "tags": { - "primaryDeviceWidth": "640", - "primaryDeviceHeight": "1136", - "sienaVersion": "20200812T204016Z-3.20074.20.0", - "deviceCapabilities": "", - "supportsPortrait": "true", - "supportsLandscape": "false", - "primaryFormFactor": "Phone", - "publisherVersion": "3.20074.20", - "minimumRequiredApiVersion": "2.2.0", - "hasComponent": "false", - "hasUnlockedComponent": "false", - "isUnifiedRootApp": "false" - }, - "properties": { - "appVersion": "2020-08-12T20:40:16Z", - "lastDraftVersion": "2020-08-12T20:40:16Z", - "lifeCycleId": "Published", - "status": "Ready", - "createdByClientVersion": { - "major": 3, - "minor": 20074, - "build": 20, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "minClientVersion": { - "major": 3, - "minor": 20074, - "build": 20, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "owner": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "createdBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastModifiedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastPublishedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "backgroundColor": "rgba(0, 176, 240, 1)", - "backgroundImageUri": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z1766ec3fd78941bea695c957e898a62a/logoSmallFile?sv=2018-03-28&sr=c&sig=sqK6%2FXY4cHidwE%2Brb3JoBV3bNToOaA6EM3%2FczbWMQDc%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "teamsColorIconUrl": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/teamsColorIcon.png?sv=2018-03-28&sr=c&sig=UYs6LV%2BGqPjfNczXP80lm%2BmG1ebFNcLCF0D8MIJ6Lt8%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "teamsOutlineIconUrl": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/teamsOutlineIcon.png?sv=2018-03-28&sr=c&sig=UYs6LV%2BGqPjfNczXP80lm%2BmG1ebFNcLCF0D8MIJ6Lt8%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "displayName": "Playwright", - "description": "", - "commitMessage": "", - "appUris": { - "documentUri": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z1766ec3fd78941bea695c957e898a62a/document.msapp?sv=2018-03-28&sr=c&sig=aToV3yl8gK0eiAPsh3DIxo3VC77OyLrZgYo2G%2BYXDgI%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z1766ec3fd78941bea695c957e898a62a/document.msapp?sv=2018-03-28&sr=c&sig=aToV3yl8gK0eiAPsh3DIxo3VC77OyLrZgYo2G%2BYXDgI%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" - }, - "imageUris": [] - }, - "createdTime": "2020-08-10T23:28:41.8191546Z", - "lastModifiedTime": "2020-08-12T20:40:20.3706202Z", - "lastPublishTime": "2020-08-12T20:40:20.3706202Z", - "sharedGroupsCount": 0, - "sharedUsersCount": 0, - "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/f581c872-9852-4100-8e25-3d6891595204", - "appOpenUri": "https://apps.powerapps.com/play/f581c872-9852-4100-8e25-3d6891595204?tenantId=e8954f17-a373-4b61-b54d-45c038fe3188", - "connectionReferences": { - "dd1ebcc1-9930-4e87-a680-45fb1eaf94e6": { - "id": "/providers/microsoft.powerapps/apis/shared_office365users", - "displayName": "Office 365 Users", - "iconUri": "https://connectoricons-prod.azureedge.net/releases/v1.0.1381/1.0.1381.2096/office365users/icon.png", - "dataSources": [ - "Office365Users" - ], - "dependencies": [], - "dependents": [], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": {}, - "apiTier": "Standard", - "isCustomApiConnection": false - } - }, - "userAppMetadata": { - "favorite": "NotSpecified", - "lastOpenedTime": "2020-08-13T23:26:44.2982102Z", - "includeInAppsList": true - }, - "isFeaturedApp": false, - "bypassConsent": false, - "isHeroApp": false, - "environment": { - "id": "/providers/Microsoft.PowerApps/environments/Default-e8954f17-a373-4b61-b54d-45c038fe3188", - "name": "Default-e8954f17-a373-4b61-b54d-45c038fe3188" - }, - "appPackageDetails": { - "playerPackage": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/player.msappk?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/player.msappk?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "sizeInBytes": 0 - }, - "webPackage": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/web/index.web.html?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/web/index.web.html?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" - }, - "unauthenticatedWebPackage": { - "value": "https://pafeblobprodln.blob.core.windows.net/alt20200810t000000zc57cd52652b24a1eb573f7b2a36a10a9/20200812T204028Z/index.web.html" - }, - "documentServerVersion": { - "major": 3, - "minor": 20074, - "build": 20, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "appPackageResourcesKind": "Split", - "packagePropertiesJson": "{\"cdnUrl\":\"https://content.powerapps.com/resource/app\",\"preLoadIdx\":\"https://content.powerapps.com/resource/app/4g3nunecadgk9/preloadindex.web.html\",\"id\":\"637328616254057865\",\"v\":2.1}" - }, - "almMode": "Environment", - "performanceOptimizationEnabled": true, - "unauthenticatedWebPackageHint": "1eef5df9-6032-459c-9194-77d926b11f37", - "canConsumeAppPass": true, - "appPlanClassification": "Standard", - "usesPremiumApi": false, - "usesOnlyGrandfatheredPremiumApis": true, - "usesCustomApi": false, - "usesOnPremiseGateway": false - }, - "isAppComponentLibrary": false, - "appType": "ClassicCanvasApp", - "displayName": "Playwright", - "description": "", - "appVersion": "2020-08-12T20:40:16Z", - "owner": "" - } - )); + assert(loggerLogSpy.calledWith(apps[2])); }); it('correctly handles App not found using name', async () => { @@ -2126,474 +705,6 @@ describe(commands.APP_GET, () => { it('correctly handles App not found using displayName (debug)', async () => { - const apps = [ - { - "name": "4d4bb961-eef9-4258-8516-aa8d64e6b477", - "id": "/providers/Microsoft.PowerApps/apps/4d4bb961-eef9-4258-8516-aa8d64e6b477", - "type": "Microsoft.PowerApps/apps", - "tags": { - "primaryDeviceWidth": "1366", - "primaryDeviceHeight": "768", - "sienaVersion": "20200512T062535Z-3.20023.8.0", - "deviceCapabilities": "", - "supportsPortrait": "false", - "supportsLandscape": "true", - "primaryFormFactor": "Tablet", - "publisherVersion": "3.20023.8", - "minimumRequiredApiVersion": "2.2.0", - "hasComponent": "false", - "hasUnlockedComponent": "false" - }, - "properties": { - "appVersion": "2020-07-08T12:28:37Z", - "lastDraftVersion": "2020-07-08T12:28:37Z", - "lifeCycleId": "Published", - "status": "Ready", - "createdByClientVersion": { - "major": 3, - "minor": 20023, - "build": 8, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "minClientVersion": { - "major": 3, - "minor": 20023, - "build": 8, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "owner": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "createdBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastModifiedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastPublishedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "backgroundColor": "rgba(37, 62, 143, 1)", - "backgroundImageUri": "https://pafeblobprodln.blob.core.windows.net:443/20200708t000000z4d9d5509e6c745d3bbd4d6d317890ccd/13103204444004720806/N0eb33631-4950-45e8-b569-8ba8611af629-logoSmallFile?sv=2018-03-28&sr=c&sig=rTJyePWWDMM6mvIhZaOkRsEdLxFE4X6UGXjrqrz3iYo%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "displayName": "Request-a-team", - "description": "", - "commitMessage": "", - "appUris": { - "documentUri": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200708t000000z4d9d5509e6c745d3bbd4d6d317890ccd/13103204444004720806/N9d70c8fe-cbc0-4226-8818-372c4261e0c6-document.msapp?sv=2018-03-28&sr=c&sig=ltod6hA3brZQF9qTxNKFg0ryuX7IxsrJLY8KdA9u8f8%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200708t000000z4d9d5509e6c745d3bbd4d6d317890ccd/13103204444004720806/N9d70c8fe-cbc0-4226-8818-372c4261e0c6-document.msapp?sv=2018-03-28&sr=c&sig=ltod6hA3brZQF9qTxNKFg0ryuX7IxsrJLY8KdA9u8f8%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" - }, - "imageUris": [] - }, - "createdTime": "2020-07-08T12:28:37.957179Z", - "lastModifiedTime": "2020-07-08T12:28:38.7556554Z", - "lastPublishTime": "2020-07-08T12:28:37Z", - "sharedGroupsCount": 0, - "sharedUsersCount": 0, - "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/4d4bb961-eef9-4258-8516-aa8d64e6b477", - "appOpenUri": "https://apps.powerapps.com/play/4d4bb961-eef9-4258-8516-aa8d64e6b477?tenantId=e8954f17-a373-4b61-b54d-45c038fe3188", - "connectionReferences": { - "9d5036a3-8b23-4125-a5cc-7dc0dbb2f8cb": { - "id": "/providers/microsoft.powerapps/apis/shared_office365users", - "displayName": "Office 365 Users", - "iconUri": "https://connectoricons-prod.azureedge.net/office365users/icon_1.0.1357.2029.png", - "dataSources": [ - "Office365Users" - ], - "dependencies": [], - "dependents": [], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": {}, - "apiTier": "Standard", - "isCustomApiConnection": false - }, - "a65df3f8-e66c-4cbd-b13f-458b7e96f677": { - "id": "/providers/microsoft.powerapps/apis/shared_office365groups", - "displayName": "Office 365 Groups", - "iconUri": "https://connectoricons-prod.azureedge.net/office365groups/icon_1.0.1329.1953.png", - "dataSources": [ - "Office365Groups" - ], - "dependencies": [], - "dependents": [], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": {}, - "apiTier": "Standard", - "isCustomApiConnection": false - }, - "041cbeda-55ca-4c48-b8e3-03928fb72bb2": { - "id": "/providers/microsoft.powerapps/apis/shared_logicflows", - "displayName": "Logic flows", - "iconUri": "https://resourcestackdeploy.blob.core.windows.net/scripts/13276078.png", - "dataSources": [ - "CheckTeamAvailability" - ], - "dependencies": [ - "97e5ce6b-9f9a-4186-885f-9b5d6476c732" - ], - "dependents": [], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": {}, - "apiTier": "Standard", - "isCustomApiConnection": false - }, - "97e5ce6b-9f9a-4186-885f-9b5d6476c732": { - "id": "/providers/microsoft.powerapps/apis/shared_sharepointonline", - "displayName": "SharePoint", - "iconUri": "https://connectoricons-prod.azureedge.net/sharepointonline/icon_1.0.1363.2042.png", - "dataSources": [], - "dependencies": [], - "dependents": [ - "041cbeda-55ca-4c48-b8e3-03928fb72bb2" - ], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": {}, - "apiTier": "Standard", - "isCustomApiConnection": false - }, - "00deca03-387b-4ad4-bbd4-cefc640d1c9b": { - "id": "/providers/microsoft.powerapps/apis/shared_sharepointonline", - "displayName": "SharePoint", - "iconUri": "https://connectoricons-prod.azureedge.net/sharepointonline/icon_1.0.1363.2042.png", - "dataSources": [ - "Teams Templates", - "Teams Requests", - "Team Request Settings" - ], - "dependencies": [], - "dependents": [], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": { - "https://contoso.sharepoint.com/sites/RequestateamApp": { - "dataSources": { - "Teams Templates": { - "tableName": "298485ad-73cc-4b5f-a013-b56111ec351a" - }, - "Teams Requests": { - "tableName": "a471ecf0-01f3-4e3e-902b-b48daaa23aba" - }, - "Team Request Settings": { - "tableName": "3770cede-bff2-42a6-ba12-2f4cbccb90d3" - } - } - } - }, - "apiTier": "Standard", - "isCustomApiConnection": false - } - }, - "databaseReferences": {}, - "userAppMetadata": { - "favorite": "NotSpecified", - "includeInAppsList": true - }, - "isFeaturedApp": false, - "bypassConsent": false, - "isHeroApp": false, - "environment": { - "id": "/providers/Microsoft.PowerApps/environments/Default-e8954f17-a373-4b61-b54d-45c038fe3188", - "name": "Default-e8954f17-a373-4b61-b54d-45c038fe3188" - }, - "almMode": "Environment", - "performanceOptimizationEnabled": false, - "canConsumeAppPass": true, - "appPlanClassification": "Standard", - "usesPremiumApi": false, - "usesOnlyGrandfatheredPremiumApis": true, - "usesCustomApi": false, - "usesOnPremiseGateway": false - }, - "isAppComponentLibrary": false, - "appType": "ClassicCanvasApp" - }, - { - "name": "79506a60-9c4c-4798-a1fa-aea552ef046e", - "id": "/providers/Microsoft.PowerApps/apps/79506a60-9c4c-4798-a1fa-aea552ef046e", - "type": "Microsoft.PowerApps/apps", - "tags": { - "minimumRequiredApiVersion": "2.2.0" - }, - "properties": { - "appVersion": "2020-06-08T20:52:24Z", - "lastDraftVersion": "2020-06-08T20:52:24Z", - "lifeCycleId": "Published", - "status": "Ready", - "createdByClientVersion": { - "major": 3, - "minor": 18114, - "build": 26, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "minClientVersion": { - "major": 3, - "minor": 18114, - "build": 26, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "owner": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "createdBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastModifiedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastPublishedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "backgroundColor": "rgba(0, 176, 240, 1)", - "backgroundImageUri": "https://pafeblobprodln.blob.core.windows.net:443/20200608t000000z1cbf48a3f3b54583b8932510cbdf20b0/6342866521103212774/N90efe94c-af45-4639-885e-d69f32cd6c9f-logoSmallFile?sv=2018-03-28&sr=c&sig=mm7Cj0z%2FlX42FaSCSA9MtwBxMVEEnveqb1%2FsQhfLsRw%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "displayName": "Toolkit", - "description": "", - "appUris": { - "documentUri": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200608t000000z1cbf48a3f3b54583b8932510cbdf20b0/6342866521103212774/N1bc8ee4e-1a31-4917-86f8-b9309667d09b-document.msapp?sv=2018-03-28&sr=c&sig=vcph4RCCqlB6Hc78oScTcfdkMfj6dMggsvPxxqrBVpU%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200608t000000z1cbf48a3f3b54583b8932510cbdf20b0/6342866521103212774/N1bc8ee4e-1a31-4917-86f8-b9309667d09b-document.msapp?sv=2018-03-28&sr=c&sig=vcph4RCCqlB6Hc78oScTcfdkMfj6dMggsvPxxqrBVpU%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" - }, - "imageUris": [] - }, - "createdTime": "2020-06-08T20:52:24.1796831Z", - "lastModifiedTime": "2020-06-08T20:52:24.4140538Z", - "lastPublishTime": "2020-06-08T20:52:24Z", - "sharedGroupsCount": 0, - "sharedUsersCount": 0, - "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/79506a60-9c4c-4798-a1fa-aea552ef046e", - "appOpenUri": "https://apps.powerapps.com/play/79506a60-9c4c-4798-a1fa-aea552ef046e?tenantId=e8954f17-a373-4b61-b54d-45c038fe3188", - "databaseReferences": {}, - "userAppMetadata": { - "favorite": "NotSpecified", - "includeInAppsList": true - }, - "isFeaturedApp": false, - "bypassConsent": false, - "isHeroApp": false, - "environment": { - "id": "/providers/Microsoft.PowerApps/environments/Default-e8954f17-a373-4b61-b54d-45c038fe3188", - "name": "Default-e8954f17-a373-4b61-b54d-45c038fe3188" - }, - "almMode": "Environment", - "appPlanClassification": "Standard", - "usesPremiumApi": false, - "usesOnlyGrandfatheredPremiumApis": true, - "usesCustomApi": false, - "usesOnPremiseGateway": false - }, - "appType": "ClassicCanvasApp" - }, - { - "name": "f581c872-9852-4100-8e25-3d6891595204", - "id": "/providers/Microsoft.PowerApps/apps/f581c872-9852-4100-8e25-3d6891595204", - "type": "Microsoft.PowerApps/apps", - "tags": { - "primaryDeviceWidth": "640", - "primaryDeviceHeight": "1136", - "sienaVersion": "20200812T204016Z-3.20074.20.0", - "deviceCapabilities": "", - "supportsPortrait": "true", - "supportsLandscape": "false", - "primaryFormFactor": "Phone", - "publisherVersion": "3.20074.20", - "minimumRequiredApiVersion": "2.2.0", - "hasComponent": "false", - "hasUnlockedComponent": "false", - "isUnifiedRootApp": "false" - }, - "properties": { - "appVersion": "2020-08-12T20:40:16Z", - "lastDraftVersion": "2020-08-12T20:40:16Z", - "lifeCycleId": "Published", - "status": "Ready", - "createdByClientVersion": { - "major": 3, - "minor": 20074, - "build": 20, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "minClientVersion": { - "major": 3, - "minor": 20074, - "build": 20, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "owner": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "createdBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastModifiedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "lastPublishedBy": { - "id": "a86f34fb-fc0b-476f-b2d3-84b2648cc87a", - "displayName": "John Doe", - "email": "john.doe@contoso.onmicrosoft.com", - "type": "User", - "tenantId": "e8954f17-a373-4b61-b54d-45c038fe3188", - "userPrincipalName": "john.doe@contoso.onmicrosoft.com" - }, - "backgroundColor": "rgba(0, 176, 240, 1)", - "backgroundImageUri": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z1766ec3fd78941bea695c957e898a62a/logoSmallFile?sv=2018-03-28&sr=c&sig=sqK6%2FXY4cHidwE%2Brb3JoBV3bNToOaA6EM3%2FczbWMQDc%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "teamsColorIconUrl": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/teamsColorIcon.png?sv=2018-03-28&sr=c&sig=UYs6LV%2BGqPjfNczXP80lm%2BmG1ebFNcLCF0D8MIJ6Lt8%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "teamsOutlineIconUrl": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/teamsOutlineIcon.png?sv=2018-03-28&sr=c&sig=UYs6LV%2BGqPjfNczXP80lm%2BmG1ebFNcLCF0D8MIJ6Lt8%3D&se=2020-10-05T18%3A56%3A46Z&sp=rl", - "displayName": "Playwright", - "description": "", - "commitMessage": "", - "appUris": { - "documentUri": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z1766ec3fd78941bea695c957e898a62a/document.msapp?sv=2018-03-28&sr=c&sig=aToV3yl8gK0eiAPsh3DIxo3VC77OyLrZgYo2G%2BYXDgI%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z1766ec3fd78941bea695c957e898a62a/document.msapp?sv=2018-03-28&sr=c&sig=aToV3yl8gK0eiAPsh3DIxo3VC77OyLrZgYo2G%2BYXDgI%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" - }, - "imageUris": [] - }, - "createdTime": "2020-08-10T23:28:41.8191546Z", - "lastModifiedTime": "2020-08-12T20:40:20.3706202Z", - "lastPublishTime": "2020-08-12T20:40:20.3706202Z", - "sharedGroupsCount": 0, - "sharedUsersCount": 0, - "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/f581c872-9852-4100-8e25-3d6891595204", - "appOpenUri": "https://apps.powerapps.com/play/f581c872-9852-4100-8e25-3d6891595204?tenantId=e8954f17-a373-4b61-b54d-45c038fe3188", - "connectionReferences": { - "dd1ebcc1-9930-4e87-a680-45fb1eaf94e6": { - "id": "/providers/microsoft.powerapps/apis/shared_office365users", - "displayName": "Office 365 Users", - "iconUri": "https://connectoricons-prod.azureedge.net/releases/v1.0.1381/1.0.1381.2096/office365users/icon.png", - "dataSources": [ - "Office365Users" - ], - "dependencies": [], - "dependents": [], - "isOnPremiseConnection": false, - "bypassConsent": false, - "dataSets": {}, - "apiTier": "Standard", - "isCustomApiConnection": false - } - }, - "userAppMetadata": { - "favorite": "NotSpecified", - "lastOpenedTime": "2020-08-13T23:26:44.2982102Z", - "includeInAppsList": true - }, - "isFeaturedApp": false, - "bypassConsent": false, - "isHeroApp": false, - "environment": { - "id": "/providers/Microsoft.PowerApps/environments/Default-e8954f17-a373-4b61-b54d-45c038fe3188", - "name": "Default-e8954f17-a373-4b61-b54d-45c038fe3188" - }, - "appPackageDetails": { - "playerPackage": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/player.msappk?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/player.msappk?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "sizeInBytes": 0 - }, - "webPackage": { - "value": "https://pafeblobprodln.blob.core.windows.net:443/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/web/index.web.html?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl", - "readonlyValue": "https://pafeblobprodln-secondary.blob.core.windows.net/20200812t000000z4928635e44124aa5b50bfae36ed252b5/05358dc3-4770-4f73-a5ec-fe0a3e341454/web/index.web.html?sv=2018-03-28&sr=c&sig=UXTet030wmU8QR2TH8TWCrgm354F2LTjgIubPcfXGD4%3D&se=2020-08-28T08%3A00%3A00Z&sp=rl" - }, - "unauthenticatedWebPackage": { - "value": "https://pafeblobprodln.blob.core.windows.net/alt20200810t000000zc57cd52652b24a1eb573f7b2a36a10a9/20200812T204028Z/index.web.html" - }, - "documentServerVersion": { - "major": 3, - "minor": 20074, - "build": 20, - "revision": 0, - "majorRevision": 0, - "minorRevision": 0 - }, - "appPackageResourcesKind": "Split", - "packagePropertiesJson": "{\"cdnUrl\":\"https://content.powerapps.com/resource/app\",\"preLoadIdx\":\"https://content.powerapps.com/resource/app/4g3nunecadgk9/preloadindex.web.html\",\"id\":\"637328616254057865\",\"v\":2.1}" - }, - "almMode": "Environment", - "performanceOptimizationEnabled": true, - "unauthenticatedWebPackageHint": "1eef5df9-6032-459c-9194-77d926b11f37", - "canConsumeAppPass": true, - "appPlanClassification": "Standard", - "usesPremiumApi": false, - "usesOnlyGrandfatheredPremiumApis": true, - "usesCustomApi": false, - "usesOnPremiseGateway": false - }, - "isAppComponentLibrary": false, - "appType": "ClassicCanvasApp" - } - ]; - sinon.stub(cli, 'executeCommandWithOutput').callsFake(async (command): Promise => { if (command === paAppListCommand) { return { "stdout": JSON.stringify(apps) }; diff --git a/src/m365/pa/commands/app/app-get.ts b/src/m365/pa/commands/app/app-get.ts index 7c79c80d536..47fb8e9b31c 100644 --- a/src/m365/pa/commands/app/app-get.ts +++ b/src/m365/pa/commands/app/app-get.ts @@ -97,8 +97,13 @@ class PaAppGetCommand extends PowerAppsCommand { public async commandAction(logger: Logger, args: CommandArgs): Promise { try { if (args.options.name) { + let endpoint = `${this.resource}/providers/Microsoft.PowerApps/apps/${formatting.encodeQueryParameter(args.options.name)}?api-version=2016-11-01`; + if (args.options.asAdmin) { + endpoint = `${this.resource}/providers/Microsoft.PowerApps/scopes/admin/environments/${formatting.encodeQueryParameter(args.options.environmentName!)}/apps/${formatting.encodeQueryParameter(args.options.name)}?api-version=2016-11-01`; + } + const requestOptions: CliRequestOptions = { - url: `${this.resource}/providers/Microsoft.PowerApps${args.options.asAdmin ? '/scopes/admin' : ''}${args.options.environmentName ? '/environments/' + formatting.encodeQueryParameter(args.options.environmentName) : ''}/apps/${formatting.encodeQueryParameter(args.options.name)}?api-version=2016-11-01`, + url: endpoint, headers: { accept: 'application/json' }, From f7d1f6891bccabaecfdbdbc3790519254dea06b0 Mon Sep 17 00:00:00 2001 From: Martin Machacek Date: Tue, 2 Jan 2024 08:11:35 +0100 Subject: [PATCH 4/4] Enhancement: Run "pa app get" as admin --- src/m365/pa/commands/app/app-get.spec.ts | 318 ++++++++++++++++++++++- src/m365/pa/commands/app/app-get.ts | 5 +- 2 files changed, 309 insertions(+), 14 deletions(-) diff --git a/src/m365/pa/commands/app/app-get.spec.ts b/src/m365/pa/commands/app/app-get.spec.ts index 849dc77e0b5..c91dd7aa4d9 100644 --- a/src/m365/pa/commands/app/app-get.spec.ts +++ b/src/m365/pa/commands/app/app-get.spec.ts @@ -491,6 +491,304 @@ describe(commands.APP_GET, () => { "description": "", "appVersion": "2020-08-12T20:40:16Z", "owner": "john.doe@contoso.onmicrosoft.com" + }, + { + "name": "5369f386-e380-46cb-82a4-4e18f9e4f3a7", + "id": "/providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7", + "type": "Microsoft.PowerApps/apps", + "tags": { + "primaryDeviceWidth": "640", + "primaryDeviceHeight": "1136", + "sienaVersion": "20210118T125447Z-3.20123.24.0", + "deviceCapabilities": "", + "supportsPortrait": "true", + "supportsLandscape": "false", + "primaryFormFactor": "Phone", + "publisherVersion": "3.20123.24", + "minimumRequiredApiVersion": "2.2.0", + "hasComponent": "false", + "hasUnlockedComponent": "false", + "isUnifiedRootApp": "false" + }, + "properties": { + "appVersion": "2021-01-18T12:54:47Z", + "createdByClientVersion": { + "major": 3, + "minor": 20123, + "build": 24, + "revision": 0, + "majorRevision": 0, + "minorRevision": 0 + }, + "minClientVersion": { + "major": 3, + "minor": 20123, + "build": 24, + "revision": 0, + "majorRevision": 0, + "minorRevision": 0 + }, + "owner": { + "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", + "displayName": "Contoso Admin", + "email": "admin@contoso.com", + "type": "User", + "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", + "userPrincipalName": "admin@contoso.com" + }, + "createdBy": { + "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", + "displayName": "Contoso Admin", + "email": "admin@contoso.com", + "type": "User", + "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", + "userPrincipalName": "admin@contoso.com" + }, + "lastModifiedBy": { + "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", + "displayName": "Contoso Admin", + "email": "admin@contoso.com", + "type": "User", + "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", + "userPrincipalName": "admin@contoso.com" + }, + "backgroundColor": "rgba(0, 176, 240, 1)", + "backgroundImageUri": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/logoSmallFile?sv=2018-03-28&sr=c&sig=Y5OvBpqU9EXwpXthPre62%2B24zwCNS9ihPfCNmBmuXro%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", + "teamsColorIconUrl": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z7f1ae936e0c84483a435f047250f9a90/teamsColorIcon.png?sv=2018-03-28&sr=c&sig=ECrnlPPWWirepGA0BwPAfi3RDcNxugeuBajcE9DvJcI%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", + "teamsOutlineIconUrl": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z7f1ae936e0c84483a435f047250f9a90/teamsOutlineIcon.png?sv=2018-03-28&sr=c&sig=ECrnlPPWWirepGA0BwPAfi3RDcNxugeuBajcE9DvJcI%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", + "displayName": "App", + "description": "test", + "appUris": { + "documentUri": { + "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/document.msapp?sv=2018-03-28&sr=c&sig=bx4dLMgjOurFPWW%2FuanqlJlb1clSqH05cZDPgbEkEno%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/document.msapp?sv=2018-03-28&sr=c&sig=bx4dLMgjOurFPWW%2FuanqlJlb1clSqH05cZDPgbEkEno%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" + }, + "imageUris": [] + }, + "createdTime": "2021-01-18T12:54:47.9591484Z", + "lastModifiedTime": "2021-01-18T12:54:48.0998249Z", + "sharedGroupsCount": 0, + "sharedUsersCount": 0, + "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7", + "appOpenUri": "https://apps.powerapps.com/play/5369f386-e380-46cb-82a4-4e18f9e4f3a7?tenantId=2ca3eaa5-140f-4175-9563-1172edf9f339&hint=c67d9086-a429-45b8-8b19-91fab5174177", + "connectionReferences": { + "c189738b-6a2d-4713-939d-e2ed35101124": { + "id": "/providers/microsoft.powerapps/apis/shared_sharepointonline", + "displayName": "SharePoint", + "iconUri": "https://connectoricons-prod.azureedge.net/releases/v1.0.1431/1.0.1431.2301/sharepointonline/icon.png", + "dataSources": ["ICT Aanvragen"], + "dependencies": [], + "dependents": [], + "parameterHints": {}, + "isOnPremiseConnection": false, + "bypassConsent": false, + "apiTier": "Standard", + "isCustomApiConnection": false + } + }, + "userAppMetadata": { + "favorite": "NotSpecified", + "includeInAppsList": true + }, + "isFeaturedApp": false, + "bypassConsent": false, + "isHeroApp": false, + "environment": { + "id": "/providers/Microsoft.PowerApps/environments/Default-2ca3eaa5-140f-4175-9563-1172edf9f339", + "name": "Default-2ca3eaa5-140f-4175-9563-1172edf9f339" + }, + "appPackageDetails": { + "playerPackage": { + "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/player.msappk?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", + "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/player.msappk?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" + }, + "webPackage": { + "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/web/index.web.html?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", + "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/web/index.web.html?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" + }, + "unauthenticatedWebPackage": { + "value": "https://pafeblobprodam.blob.core.windows.net/alt20210118t000000z84a0aa047e784c87b15a6529a8f7ab50/20210118T125458Z/index.web.html" + }, + "documentServerVersion": { + "major": 3, + "minor": 20123, + "build": 24, + "revision": 0, + "majorRevision": 0, + "minorRevision": 0 + }, + "appPackageResourcesKind": "Split", + "packagePropertiesJson": "{\"cdnUrl\":\"https://content.powerapps.com/resource/app\",\"preLoadIdx\":\"https://content.powerapps.com/resource/app/a5ccjkurht6g5/preloadindex.web.html\",\"id\":\"637465712959244709\",\"v\":2.1}" + }, + "almMode": "Environment", + "performanceOptimizationEnabled": true, + "unauthenticatedWebPackageHint": "c67d9086-a429-45b8-8b19-91fab5174177", + "canConsumeAppPass": true, + "executionRestrictions": { + "isTeamsOnly": false, + "dataLossPreventionEvaluationResult": { + "status": "Compliant", + "lastEvaluationDate": "2021-01-18T12:54:58.0824718Z", + "violationDetails": [] + } + }, + "appPlanClassification": "Standard", + "usesPremiumApi": false, + "usesOnlyGrandfatheredPremiumApis": true, + "usesCustomApi": false, + "usesOnPremiseGateway": false, + "isCustomizable": true + }, + "isAppComponentLibrary": false, + "appType": "ClassicCanvasApp" + }, + { + "name": "9142a1b7-bb93-4a13-aa9b-8651e89f5e5d", + "id": "/providers/Microsoft.PowerApps/apps/9142a1b7-bb93-4a13-aa9b-8651e89f5e5d", + "type": "Microsoft.PowerApps/apps", + "tags": { + "primaryDeviceWidth": "640", + "primaryDeviceHeight": "1136", + "sienaVersion": "20210118T125447Z-3.20123.24.0", + "deviceCapabilities": "", + "supportsPortrait": "true", + "supportsLandscape": "false", + "primaryFormFactor": "Phone", + "publisherVersion": "3.20123.24", + "minimumRequiredApiVersion": "2.2.0", + "hasComponent": "false", + "hasUnlockedComponent": "false", + "isUnifiedRootApp": "false" + }, + "properties": { + "appVersion": "2021-01-18T12:54:47Z", + "createdByClientVersion": { + "major": 3, + "minor": 20123, + "build": 24, + "revision": 0, + "majorRevision": 0, + "minorRevision": 0 + }, + "minClientVersion": { + "major": 3, + "minor": 20123, + "build": 24, + "revision": 0, + "majorRevision": 0, + "minorRevision": 0 + }, + "owner": { + "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", + "displayName": "Contoso Admin", + "email": "", + "type": "User", + "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", + "userPrincipalName": "admin@contoso.com" + }, + "createdBy": { + "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", + "displayName": "Contoso Admin", + "email": "admin@contoso.com", + "type": "User", + "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", + "userPrincipalName": "admin@contoso.com" + }, + "lastModifiedBy": { + "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", + "displayName": "Contoso Admin", + "email": "admin@contoso.com", + "type": "User", + "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", + "userPrincipalName": "admin@contoso.com" + }, + "backgroundColor": "rgba(0, 176, 240, 1)", + "backgroundImageUri": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/logoSmallFile?sv=2018-03-28&sr=c&sig=Y5OvBpqU9EXwpXthPre62%2B24zwCNS9ihPfCNmBmuXro%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", + "teamsColorIconUrl": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z7f1ae936e0c84483a435f047250f9a90/teamsColorIcon.png?sv=2018-03-28&sr=c&sig=ECrnlPPWWirepGA0BwPAfi3RDcNxugeuBajcE9DvJcI%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", + "teamsOutlineIconUrl": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z7f1ae936e0c84483a435f047250f9a90/teamsOutlineIcon.png?sv=2018-03-28&sr=c&sig=ECrnlPPWWirepGA0BwPAfi3RDcNxugeuBajcE9DvJcI%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", + "displayName": "App", + "description": "", + "appUris": { + "documentUri": { + "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/document.msapp?sv=2018-03-28&sr=c&sig=bx4dLMgjOurFPWW%2FuanqlJlb1clSqH05cZDPgbEkEno%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", + "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/document.msapp?sv=2018-03-28&sr=c&sig=bx4dLMgjOurFPWW%2FuanqlJlb1clSqH05cZDPgbEkEno%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" + }, + "imageUris": [] + }, + "createdTime": "2021-01-18T12:54:47.9591484Z", + "lastModifiedTime": "2021-01-18T12:54:48.0998249Z", + "sharedGroupsCount": 0, + "sharedUsersCount": 0, + "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/9142a1b7-bb93-4a13-aa9b-8651e89f5e5d", + "appOpenUri": "https://apps.powerapps.com/play/9142a1b7-bb93-4a13-aa9b-8651e89f5e5d?tenantId=2ca3eaa5-140f-4175-9563-1172edf9f339&hint=c67d9086-a429-45b8-8b19-91fab5174177", + "connectionReferences": { + "c189738b-6a2d-4713-939d-e2ed35101124": { + "id": "/providers/microsoft.powerapps/apis/shared_sharepointonline", + "displayName": "SharePoint", + "iconUri": "https://connectoricons-prod.azureedge.net/releases/v1.0.1431/1.0.1431.2301/sharepointonline/icon.png", + "dataSources": ["ICT Aanvragen"], + "dependencies": [], + "dependents": [], + "parameterHints": {}, + "isOnPremiseConnection": false, + "bypassConsent": false, + "apiTier": "Standard", + "isCustomApiConnection": false + } + }, "userAppMetadata": { + "favorite": "NotSpecified", + "includeInAppsList": true + }, + "isFeaturedApp": false, + "bypassConsent": false, + "isHeroApp": false, + "environment": { + "id": "/providers/Microsoft.PowerApps/environments/Default-2ca3eaa5-140f-4175-9563-1172edf9f339", + "name": "Default-2ca3eaa5-140f-4175-9563-1172edf9f339" + }, + "appPackageDetails": { + "playerPackage": { + "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/player.msappk?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", + "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/player.msappk?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" + }, + "webPackage": { + "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/web/index.web.html?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", + "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/web/index.web.html?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" + }, + "unauthenticatedWebPackage": { + "value": "https://pafeblobprodam.blob.core.windows.net/alt20210118t000000z84a0aa047e784c87b15a6529a8f7ab50/20210118T125458Z/index.web.html" + }, + "documentServerVersion": { + "major": 3, + "minor": 20123, + "build": 24, + "revision": 0, + "majorRevision": 0, + "minorRevision": 0 + }, + "appPackageResourcesKind": "Split", + "packagePropertiesJson": "{\"cdnUrl\":\"https://content.powerapps.com/resource/app\",\"preLoadIdx\":\"https://content.powerapps.com/resource/app/a5ccjkurht6g5/preloadindex.web.html\",\"id\":\"637465712959244709\",\"v\":2.1}" + }, + "almMode": "Environment", + "performanceOptimizationEnabled": true, + "unauthenticatedWebPackageHint": "c67d9086-a429-45b8-8b19-91fab5174177", + "canConsumeAppPass": true, + "executionRestrictions": { + "isTeamsOnly": false, + "dataLossPreventionEvaluationResult": { + "status": "Compliant", + "lastEvaluationDate": "2021-01-18T12:54:58.0824718Z", + "violationDetails": [] + } + }, + "appPlanClassification": "Standard", + "usesPremiumApi": false, + "usesOnlyGrandfatheredPremiumApis": true, + "usesCustomApi": false, + "usesOnPremiseGateway": false, + "isCustomizable": true + }, + "isAppComponentLibrary": false, + "appType": "ClassicCanvasApp" } ]; @@ -593,7 +891,7 @@ describe(commands.APP_GET, () => { if (opts.headers && opts.headers.accept && (opts.headers.accept as string).indexOf('application/json') === 0) { - return { "name": "5369f386-e380-46cb-82a4-4e18f9e4f3a7", "id": "/providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7", "type": "Microsoft.PowerApps/apps", "tags": { "primaryDeviceWidth": "640", "primaryDeviceHeight": "1136", "sienaVersion": "20210118T125447Z-3.20123.24.0", "deviceCapabilities": "", "supportsPortrait": "true", "supportsLandscape": "false", "primaryFormFactor": "Phone", "publisherVersion": "3.20123.24", "minimumRequiredApiVersion": "2.2.0", "hasComponent": "false", "hasUnlockedComponent": "false", "isUnifiedRootApp": "false" }, "properties": { "appVersion": "2021-01-18T12:54:47Z", "createdByClientVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "minClientVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "owner": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "createdBy": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "lastModifiedBy": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "backgroundColor": "rgba(0, 176, 240, 1)", "backgroundImageUri": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/logoSmallFile?sv=2018-03-28&sr=c&sig=Y5OvBpqU9EXwpXthPre62%2B24zwCNS9ihPfCNmBmuXro%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "teamsColorIconUrl": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z7f1ae936e0c84483a435f047250f9a90/teamsColorIcon.png?sv=2018-03-28&sr=c&sig=ECrnlPPWWirepGA0BwPAfi3RDcNxugeuBajcE9DvJcI%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "teamsOutlineIconUrl": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z7f1ae936e0c84483a435f047250f9a90/teamsOutlineIcon.png?sv=2018-03-28&sr=c&sig=ECrnlPPWWirepGA0BwPAfi3RDcNxugeuBajcE9DvJcI%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "displayName": "App", "description": "test", "appUris": { "documentUri": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/document.msapp?sv=2018-03-28&sr=c&sig=bx4dLMgjOurFPWW%2FuanqlJlb1clSqH05cZDPgbEkEno%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/document.msapp?sv=2018-03-28&sr=c&sig=bx4dLMgjOurFPWW%2FuanqlJlb1clSqH05cZDPgbEkEno%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "imageUris": [] }, "createdTime": "2021-01-18T12:54:47.9591484Z", "lastModifiedTime": "2021-01-18T12:54:48.0998249Z", "sharedGroupsCount": 0, "sharedUsersCount": 0, "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7", "appOpenUri": "https://apps.powerapps.com/play/5369f386-e380-46cb-82a4-4e18f9e4f3a7?tenantId=2ca3eaa5-140f-4175-9563-1172edf9f339&hint=c67d9086-a429-45b8-8b19-91fab5174177", "connectionReferences": { "c189738b-6a2d-4713-939d-e2ed35101124": { "id": "/providers/microsoft.powerapps/apis/shared_sharepointonline", "displayName": "SharePoint", "iconUri": "https://connectoricons-prod.azureedge.net/releases/v1.0.1431/1.0.1431.2301/sharepointonline/icon.png", "dataSources": ["ICT Aanvragen"], "dependencies": [], "dependents": [], "parameterHints": {}, "isOnPremiseConnection": false, "bypassConsent": false, "apiTier": "Standard", "isCustomApiConnection": false } }, "userAppMetadata": { "favorite": "NotSpecified", "includeInAppsList": true }, "isFeaturedApp": false, "bypassConsent": false, "isHeroApp": false, "environment": { "id": "/providers/Microsoft.PowerApps/environments/Default-2ca3eaa5-140f-4175-9563-1172edf9f339", "name": "Default-2ca3eaa5-140f-4175-9563-1172edf9f339" }, "appPackageDetails": { "playerPackage": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/player.msappk?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/player.msappk?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "webPackage": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/web/index.web.html?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/web/index.web.html?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "unauthenticatedWebPackage": { "value": "https://pafeblobprodam.blob.core.windows.net/alt20210118t000000z84a0aa047e784c87b15a6529a8f7ab50/20210118T125458Z/index.web.html" }, "documentServerVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "appPackageResourcesKind": "Split", "packagePropertiesJson": "{\"cdnUrl\":\"https://content.powerapps.com/resource/app\",\"preLoadIdx\":\"https://content.powerapps.com/resource/app/a5ccjkurht6g5/preloadindex.web.html\",\"id\":\"637465712959244709\",\"v\":2.1}" }, "almMode": "Environment", "performanceOptimizationEnabled": true, "unauthenticatedWebPackageHint": "c67d9086-a429-45b8-8b19-91fab5174177", "canConsumeAppPass": true, "executionRestrictions": { "isTeamsOnly": false, "dataLossPreventionEvaluationResult": { "status": "Compliant", "lastEvaluationDate": "2021-01-18T12:54:58.0824718Z", "violationDetails": [] } }, "appPlanClassification": "Standard", "usesPremiumApi": false, "usesOnlyGrandfatheredPremiumApis": true, "usesCustomApi": false, "usesOnPremiseGateway": false, "isCustomizable": true }, "isAppComponentLibrary": false, "appType": "ClassicCanvasApp" }; + return apps[3]; } } @@ -601,7 +899,7 @@ describe(commands.APP_GET, () => { }); await command.action(logger, { options: { debug: true, name: '5369f386-e380-46cb-82a4-4e18f9e4f3a7' } }); - assert(loggerLogSpy.calledWith({ "name": "5369f386-e380-46cb-82a4-4e18f9e4f3a7", "id": "/providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7", "type": "Microsoft.PowerApps/apps", "tags": { "primaryDeviceWidth": "640", "primaryDeviceHeight": "1136", "sienaVersion": "20210118T125447Z-3.20123.24.0", "deviceCapabilities": "", "supportsPortrait": "true", "supportsLandscape": "false", "primaryFormFactor": "Phone", "publisherVersion": "3.20123.24", "minimumRequiredApiVersion": "2.2.0", "hasComponent": "false", "hasUnlockedComponent": "false", "isUnifiedRootApp": "false" }, "properties": { "appVersion": "2021-01-18T12:54:47Z", "createdByClientVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "minClientVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "owner": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "createdBy": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "lastModifiedBy": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "backgroundColor": "rgba(0, 176, 240, 1)", "backgroundImageUri": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/logoSmallFile?sv=2018-03-28&sr=c&sig=Y5OvBpqU9EXwpXthPre62%2B24zwCNS9ihPfCNmBmuXro%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "teamsColorIconUrl": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z7f1ae936e0c84483a435f047250f9a90/teamsColorIcon.png?sv=2018-03-28&sr=c&sig=ECrnlPPWWirepGA0BwPAfi3RDcNxugeuBajcE9DvJcI%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "teamsOutlineIconUrl": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z7f1ae936e0c84483a435f047250f9a90/teamsOutlineIcon.png?sv=2018-03-28&sr=c&sig=ECrnlPPWWirepGA0BwPAfi3RDcNxugeuBajcE9DvJcI%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "displayName": "App", "description": "test", "appUris": { "documentUri": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/document.msapp?sv=2018-03-28&sr=c&sig=bx4dLMgjOurFPWW%2FuanqlJlb1clSqH05cZDPgbEkEno%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/document.msapp?sv=2018-03-28&sr=c&sig=bx4dLMgjOurFPWW%2FuanqlJlb1clSqH05cZDPgbEkEno%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "imageUris": [] }, "createdTime": "2021-01-18T12:54:47.9591484Z", "lastModifiedTime": "2021-01-18T12:54:48.0998249Z", "sharedGroupsCount": 0, "sharedUsersCount": 0, "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7", "appOpenUri": "https://apps.powerapps.com/play/5369f386-e380-46cb-82a4-4e18f9e4f3a7?tenantId=2ca3eaa5-140f-4175-9563-1172edf9f339&hint=c67d9086-a429-45b8-8b19-91fab5174177", "connectionReferences": { "c189738b-6a2d-4713-939d-e2ed35101124": { "id": "/providers/microsoft.powerapps/apis/shared_sharepointonline", "displayName": "SharePoint", "iconUri": "https://connectoricons-prod.azureedge.net/releases/v1.0.1431/1.0.1431.2301/sharepointonline/icon.png", "dataSources": ["ICT Aanvragen"], "dependencies": [], "dependents": [], "parameterHints": {}, "isOnPremiseConnection": false, "bypassConsent": false, "apiTier": "Standard", "isCustomApiConnection": false } }, "userAppMetadata": { "favorite": "NotSpecified", "includeInAppsList": true }, "isFeaturedApp": false, "bypassConsent": false, "isHeroApp": false, "environment": { "id": "/providers/Microsoft.PowerApps/environments/Default-2ca3eaa5-140f-4175-9563-1172edf9f339", "name": "Default-2ca3eaa5-140f-4175-9563-1172edf9f339" }, "appPackageDetails": { "playerPackage": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/player.msappk?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/player.msappk?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "webPackage": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/web/index.web.html?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/web/index.web.html?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "unauthenticatedWebPackage": { "value": "https://pafeblobprodam.blob.core.windows.net/alt20210118t000000z84a0aa047e784c87b15a6529a8f7ab50/20210118T125458Z/index.web.html" }, "documentServerVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "appPackageResourcesKind": "Split", "packagePropertiesJson": "{\"cdnUrl\":\"https://content.powerapps.com/resource/app\",\"preLoadIdx\":\"https://content.powerapps.com/resource/app/a5ccjkurht6g5/preloadindex.web.html\",\"id\":\"637465712959244709\",\"v\":2.1}" }, "almMode": "Environment", "performanceOptimizationEnabled": true, "unauthenticatedWebPackageHint": "c67d9086-a429-45b8-8b19-91fab5174177", "canConsumeAppPass": true, "executionRestrictions": { "isTeamsOnly": false, "dataLossPreventionEvaluationResult": { "status": "Compliant", "lastEvaluationDate": "2021-01-18T12:54:58.0824718Z", "violationDetails": [] } }, "appPlanClassification": "Standard", "usesPremiumApi": false, "usesOnlyGrandfatheredPremiumApis": true, "usesCustomApi": false, "usesOnPremiseGateway": false, "isCustomizable": true }, "isAppComponentLibrary": false, "appType": "ClassicCanvasApp", displayName: 'App', description: 'test', appVersion: '2021-01-18T12:54:47Z', owner: 'admin@contoso.com' })); + assert(loggerLogSpy.calledWith(apps[3])); }); it('retrieves information about the specified app using name', async () => { @@ -610,7 +908,7 @@ describe(commands.APP_GET, () => { if (opts.headers && opts.headers.accept && (opts.headers.accept as string).indexOf('application/json') === 0) { - return { "name": "5369f386-e380-46cb-82a4-4e18f9e4f3a7", "id": "/providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7", "type": "Microsoft.PowerApps/apps", "tags": { "primaryDeviceWidth": "640", "primaryDeviceHeight": "1136", "sienaVersion": "20210118T125447Z-3.20123.24.0", "deviceCapabilities": "", "supportsPortrait": "true", "supportsLandscape": "false", "primaryFormFactor": "Phone", "publisherVersion": "3.20123.24", "minimumRequiredApiVersion": "2.2.0", "hasComponent": "false", "hasUnlockedComponent": "false", "isUnifiedRootApp": "false" }, "properties": { "appVersion": "2021-01-18T12:54:47Z", "createdByClientVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "minClientVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "owner": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "createdBy": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "lastModifiedBy": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "backgroundColor": "rgba(0, 176, 240, 1)", "backgroundImageUri": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/logoSmallFile?sv=2018-03-28&sr=c&sig=Y5OvBpqU9EXwpXthPre62%2B24zwCNS9ihPfCNmBmuXro%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "teamsColorIconUrl": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z7f1ae936e0c84483a435f047250f9a90/teamsColorIcon.png?sv=2018-03-28&sr=c&sig=ECrnlPPWWirepGA0BwPAfi3RDcNxugeuBajcE9DvJcI%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "teamsOutlineIconUrl": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z7f1ae936e0c84483a435f047250f9a90/teamsOutlineIcon.png?sv=2018-03-28&sr=c&sig=ECrnlPPWWirepGA0BwPAfi3RDcNxugeuBajcE9DvJcI%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "displayName": "App", "description": "", "appUris": { "documentUri": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/document.msapp?sv=2018-03-28&sr=c&sig=bx4dLMgjOurFPWW%2FuanqlJlb1clSqH05cZDPgbEkEno%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/document.msapp?sv=2018-03-28&sr=c&sig=bx4dLMgjOurFPWW%2FuanqlJlb1clSqH05cZDPgbEkEno%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "imageUris": [] }, "createdTime": "2021-01-18T12:54:47.9591484Z", "lastModifiedTime": "2021-01-18T12:54:48.0998249Z", "sharedGroupsCount": 0, "sharedUsersCount": 0, "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7", "appOpenUri": "https://apps.powerapps.com/play/5369f386-e380-46cb-82a4-4e18f9e4f3a7?tenantId=2ca3eaa5-140f-4175-9563-1172edf9f339&hint=c67d9086-a429-45b8-8b19-91fab5174177", "connectionReferences": { "c189738b-6a2d-4713-939d-e2ed35101124": { "id": "/providers/microsoft.powerapps/apis/shared_sharepointonline", "displayName": "SharePoint", "iconUri": "https://connectoricons-prod.azureedge.net/releases/v1.0.1431/1.0.1431.2301/sharepointonline/icon.png", "dataSources": ["ICT Aanvragen"], "dependencies": [], "dependents": [], "parameterHints": {}, "isOnPremiseConnection": false, "bypassConsent": false, "apiTier": "Standard", "isCustomApiConnection": false } }, "userAppMetadata": { "favorite": "NotSpecified", "includeInAppsList": true }, "isFeaturedApp": false, "bypassConsent": false, "isHeroApp": false, "environment": { "id": "/providers/Microsoft.PowerApps/environments/Default-2ca3eaa5-140f-4175-9563-1172edf9f339", "name": "Default-2ca3eaa5-140f-4175-9563-1172edf9f339" }, "appPackageDetails": { "playerPackage": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/player.msappk?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/player.msappk?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "webPackage": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/web/index.web.html?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/web/index.web.html?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "unauthenticatedWebPackage": { "value": "https://pafeblobprodam.blob.core.windows.net/alt20210118t000000z84a0aa047e784c87b15a6529a8f7ab50/20210118T125458Z/index.web.html" }, "documentServerVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "appPackageResourcesKind": "Split", "packagePropertiesJson": "{\"cdnUrl\":\"https://content.powerapps.com/resource/app\",\"preLoadIdx\":\"https://content.powerapps.com/resource/app/a5ccjkurht6g5/preloadindex.web.html\",\"id\":\"637465712959244709\",\"v\":2.1}" }, "almMode": "Environment", "performanceOptimizationEnabled": true, "unauthenticatedWebPackageHint": "c67d9086-a429-45b8-8b19-91fab5174177", "canConsumeAppPass": true, "executionRestrictions": { "isTeamsOnly": false, "dataLossPreventionEvaluationResult": { "status": "Compliant", "lastEvaluationDate": "2021-01-18T12:54:58.0824718Z", "violationDetails": [] } }, "appPlanClassification": "Standard", "usesPremiumApi": false, "usesOnlyGrandfatheredPremiumApis": true, "usesCustomApi": false, "usesOnPremiseGateway": false, "isCustomizable": true }, "isAppComponentLibrary": false, "appType": "ClassicCanvasApp" }; + return apps[3]; } } @@ -618,7 +916,7 @@ describe(commands.APP_GET, () => { }); await command.action(logger, { options: { name: '5369f386-e380-46cb-82a4-4e18f9e4f3a7' } }); - assert(loggerLogSpy.calledWith({ "name": "5369f386-e380-46cb-82a4-4e18f9e4f3a7", "id": "/providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7", "type": "Microsoft.PowerApps/apps", "tags": { "primaryDeviceWidth": "640", "primaryDeviceHeight": "1136", "sienaVersion": "20210118T125447Z-3.20123.24.0", "deviceCapabilities": "", "supportsPortrait": "true", "supportsLandscape": "false", "primaryFormFactor": "Phone", "publisherVersion": "3.20123.24", "minimumRequiredApiVersion": "2.2.0", "hasComponent": "false", "hasUnlockedComponent": "false", "isUnifiedRootApp": "false" }, "properties": { "appVersion": "2021-01-18T12:54:47Z", "createdByClientVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "minClientVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "owner": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "createdBy": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "lastModifiedBy": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "backgroundColor": "rgba(0, 176, 240, 1)", "backgroundImageUri": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/logoSmallFile?sv=2018-03-28&sr=c&sig=Y5OvBpqU9EXwpXthPre62%2B24zwCNS9ihPfCNmBmuXro%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "teamsColorIconUrl": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z7f1ae936e0c84483a435f047250f9a90/teamsColorIcon.png?sv=2018-03-28&sr=c&sig=ECrnlPPWWirepGA0BwPAfi3RDcNxugeuBajcE9DvJcI%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "teamsOutlineIconUrl": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z7f1ae936e0c84483a435f047250f9a90/teamsOutlineIcon.png?sv=2018-03-28&sr=c&sig=ECrnlPPWWirepGA0BwPAfi3RDcNxugeuBajcE9DvJcI%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "displayName": "App", "description": "", "appUris": { "documentUri": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/document.msapp?sv=2018-03-28&sr=c&sig=bx4dLMgjOurFPWW%2FuanqlJlb1clSqH05cZDPgbEkEno%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/document.msapp?sv=2018-03-28&sr=c&sig=bx4dLMgjOurFPWW%2FuanqlJlb1clSqH05cZDPgbEkEno%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "imageUris": [] }, "createdTime": "2021-01-18T12:54:47.9591484Z", "lastModifiedTime": "2021-01-18T12:54:48.0998249Z", "sharedGroupsCount": 0, "sharedUsersCount": 0, "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7", "appOpenUri": "https://apps.powerapps.com/play/5369f386-e380-46cb-82a4-4e18f9e4f3a7?tenantId=2ca3eaa5-140f-4175-9563-1172edf9f339&hint=c67d9086-a429-45b8-8b19-91fab5174177", "connectionReferences": { "c189738b-6a2d-4713-939d-e2ed35101124": { "id": "/providers/microsoft.powerapps/apis/shared_sharepointonline", "displayName": "SharePoint", "iconUri": "https://connectoricons-prod.azureedge.net/releases/v1.0.1431/1.0.1431.2301/sharepointonline/icon.png", "dataSources": ["ICT Aanvragen"], "dependencies": [], "dependents": [], "parameterHints": {}, "isOnPremiseConnection": false, "bypassConsent": false, "apiTier": "Standard", "isCustomApiConnection": false } }, "userAppMetadata": { "favorite": "NotSpecified", "includeInAppsList": true }, "isFeaturedApp": false, "bypassConsent": false, "isHeroApp": false, "environment": { "id": "/providers/Microsoft.PowerApps/environments/Default-2ca3eaa5-140f-4175-9563-1172edf9f339", "name": "Default-2ca3eaa5-140f-4175-9563-1172edf9f339" }, "appPackageDetails": { "playerPackage": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/player.msappk?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/player.msappk?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "webPackage": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/web/index.web.html?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/web/index.web.html?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "unauthenticatedWebPackage": { "value": "https://pafeblobprodam.blob.core.windows.net/alt20210118t000000z84a0aa047e784c87b15a6529a8f7ab50/20210118T125458Z/index.web.html" }, "documentServerVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "appPackageResourcesKind": "Split", "packagePropertiesJson": "{\"cdnUrl\":\"https://content.powerapps.com/resource/app\",\"preLoadIdx\":\"https://content.powerapps.com/resource/app/a5ccjkurht6g5/preloadindex.web.html\",\"id\":\"637465712959244709\",\"v\":2.1}" }, "almMode": "Environment", "performanceOptimizationEnabled": true, "unauthenticatedWebPackageHint": "c67d9086-a429-45b8-8b19-91fab5174177", "canConsumeAppPass": true, "executionRestrictions": { "isTeamsOnly": false, "dataLossPreventionEvaluationResult": { "status": "Compliant", "lastEvaluationDate": "2021-01-18T12:54:58.0824718Z", "violationDetails": [] } }, "appPlanClassification": "Standard", "usesPremiumApi": false, "usesOnlyGrandfatheredPremiumApis": true, "usesCustomApi": false, "usesOnPremiseGateway": false, "isCustomizable": true }, "isAppComponentLibrary": false, "appType": "ClassicCanvasApp", displayName: 'App', description: '', appVersion: '2021-01-18T12:54:47Z', owner: 'admin@contoso.com' })); + assert(loggerLogSpy.calledWith(apps[3])); }); it('retrieves information about the specified app using name as admin', async () => { @@ -627,7 +925,7 @@ describe(commands.APP_GET, () => { if (opts.headers && opts.headers.accept && (opts.headers.accept as string).indexOf('application/json') === 0) { - return { "name": "5369f386-e380-46cb-82a4-4e18f9e4f3a7", "id": "/providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7", "type": "Microsoft.PowerApps/apps", "tags": { "primaryDeviceWidth": "640", "primaryDeviceHeight": "1136", "sienaVersion": "20210118T125447Z-3.20123.24.0", "deviceCapabilities": "", "supportsPortrait": "true", "supportsLandscape": "false", "primaryFormFactor": "Phone", "publisherVersion": "3.20123.24", "minimumRequiredApiVersion": "2.2.0", "hasComponent": "false", "hasUnlockedComponent": "false", "isUnifiedRootApp": "false" }, "properties": { "appVersion": "2021-01-18T12:54:47Z", "createdByClientVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "minClientVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "owner": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "createdBy": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "lastModifiedBy": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "backgroundColor": "rgba(0, 176, 240, 1)", "backgroundImageUri": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/logoSmallFile?sv=2018-03-28&sr=c&sig=Y5OvBpqU9EXwpXthPre62%2B24zwCNS9ihPfCNmBmuXro%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "teamsColorIconUrl": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z7f1ae936e0c84483a435f047250f9a90/teamsColorIcon.png?sv=2018-03-28&sr=c&sig=ECrnlPPWWirepGA0BwPAfi3RDcNxugeuBajcE9DvJcI%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "teamsOutlineIconUrl": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z7f1ae936e0c84483a435f047250f9a90/teamsOutlineIcon.png?sv=2018-03-28&sr=c&sig=ECrnlPPWWirepGA0BwPAfi3RDcNxugeuBajcE9DvJcI%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "displayName": "App", "description": "", "appUris": { "documentUri": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/document.msapp?sv=2018-03-28&sr=c&sig=bx4dLMgjOurFPWW%2FuanqlJlb1clSqH05cZDPgbEkEno%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/document.msapp?sv=2018-03-28&sr=c&sig=bx4dLMgjOurFPWW%2FuanqlJlb1clSqH05cZDPgbEkEno%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "imageUris": [] }, "createdTime": "2021-01-18T12:54:47.9591484Z", "lastModifiedTime": "2021-01-18T12:54:48.0998249Z", "sharedGroupsCount": 0, "sharedUsersCount": 0, "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7", "appOpenUri": "https://apps.powerapps.com/play/5369f386-e380-46cb-82a4-4e18f9e4f3a7?tenantId=2ca3eaa5-140f-4175-9563-1172edf9f339&hint=c67d9086-a429-45b8-8b19-91fab5174177", "connectionReferences": { "c189738b-6a2d-4713-939d-e2ed35101124": { "id": "/providers/microsoft.powerapps/apis/shared_sharepointonline", "displayName": "SharePoint", "iconUri": "https://connectoricons-prod.azureedge.net/releases/v1.0.1431/1.0.1431.2301/sharepointonline/icon.png", "dataSources": ["ICT Aanvragen"], "dependencies": [], "dependents": [], "parameterHints": {}, "isOnPremiseConnection": false, "bypassConsent": false, "apiTier": "Standard", "isCustomApiConnection": false } }, "userAppMetadata": { "favorite": "NotSpecified", "includeInAppsList": true }, "isFeaturedApp": false, "bypassConsent": false, "isHeroApp": false, "environment": { "id": "/providers/Microsoft.PowerApps/environments/Default-2ca3eaa5-140f-4175-9563-1172edf9f339", "name": "Default-2ca3eaa5-140f-4175-9563-1172edf9f339" }, "appPackageDetails": { "playerPackage": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/player.msappk?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/player.msappk?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "webPackage": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/web/index.web.html?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/web/index.web.html?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "unauthenticatedWebPackage": { "value": "https://pafeblobprodam.blob.core.windows.net/alt20210118t000000z84a0aa047e784c87b15a6529a8f7ab50/20210118T125458Z/index.web.html" }, "documentServerVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "appPackageResourcesKind": "Split", "packagePropertiesJson": "{\"cdnUrl\":\"https://content.powerapps.com/resource/app\",\"preLoadIdx\":\"https://content.powerapps.com/resource/app/a5ccjkurht6g5/preloadindex.web.html\",\"id\":\"637465712959244709\",\"v\":2.1}" }, "almMode": "Environment", "performanceOptimizationEnabled": true, "unauthenticatedWebPackageHint": "c67d9086-a429-45b8-8b19-91fab5174177", "canConsumeAppPass": true, "executionRestrictions": { "isTeamsOnly": false, "dataLossPreventionEvaluationResult": { "status": "Compliant", "lastEvaluationDate": "2021-01-18T12:54:58.0824718Z", "violationDetails": [] } }, "appPlanClassification": "Standard", "usesPremiumApi": false, "usesOnlyGrandfatheredPremiumApis": true, "usesCustomApi": false, "usesOnPremiseGateway": false, "isCustomizable": true }, "isAppComponentLibrary": false, "appType": "ClassicCanvasApp" }; + return apps[3]; } } @@ -635,7 +933,7 @@ describe(commands.APP_GET, () => { }); await command.action(logger, { options: { name: '5369f386-e380-46cb-82a4-4e18f9e4f3a7', environmentName: '4ce50206-9576-4237-8b17-38d8aadfaa35', asAdmin: true } }); - assert(loggerLogSpy.calledWith({ "name": "5369f386-e380-46cb-82a4-4e18f9e4f3a7", "id": "/providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7", "type": "Microsoft.PowerApps/apps", "tags": { "primaryDeviceWidth": "640", "primaryDeviceHeight": "1136", "sienaVersion": "20210118T125447Z-3.20123.24.0", "deviceCapabilities": "", "supportsPortrait": "true", "supportsLandscape": "false", "primaryFormFactor": "Phone", "publisherVersion": "3.20123.24", "minimumRequiredApiVersion": "2.2.0", "hasComponent": "false", "hasUnlockedComponent": "false", "isUnifiedRootApp": "false" }, "properties": { "appVersion": "2021-01-18T12:54:47Z", "createdByClientVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "minClientVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "owner": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "createdBy": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "lastModifiedBy": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "backgroundColor": "rgba(0, 176, 240, 1)", "backgroundImageUri": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/logoSmallFile?sv=2018-03-28&sr=c&sig=Y5OvBpqU9EXwpXthPre62%2B24zwCNS9ihPfCNmBmuXro%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "teamsColorIconUrl": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z7f1ae936e0c84483a435f047250f9a90/teamsColorIcon.png?sv=2018-03-28&sr=c&sig=ECrnlPPWWirepGA0BwPAfi3RDcNxugeuBajcE9DvJcI%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "teamsOutlineIconUrl": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z7f1ae936e0c84483a435f047250f9a90/teamsOutlineIcon.png?sv=2018-03-28&sr=c&sig=ECrnlPPWWirepGA0BwPAfi3RDcNxugeuBajcE9DvJcI%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "displayName": "App", "description": "", "appUris": { "documentUri": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/document.msapp?sv=2018-03-28&sr=c&sig=bx4dLMgjOurFPWW%2FuanqlJlb1clSqH05cZDPgbEkEno%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/document.msapp?sv=2018-03-28&sr=c&sig=bx4dLMgjOurFPWW%2FuanqlJlb1clSqH05cZDPgbEkEno%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "imageUris": [] }, "createdTime": "2021-01-18T12:54:47.9591484Z", "lastModifiedTime": "2021-01-18T12:54:48.0998249Z", "sharedGroupsCount": 0, "sharedUsersCount": 0, "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7", "appOpenUri": "https://apps.powerapps.com/play/5369f386-e380-46cb-82a4-4e18f9e4f3a7?tenantId=2ca3eaa5-140f-4175-9563-1172edf9f339&hint=c67d9086-a429-45b8-8b19-91fab5174177", "connectionReferences": { "c189738b-6a2d-4713-939d-e2ed35101124": { "id": "/providers/microsoft.powerapps/apis/shared_sharepointonline", "displayName": "SharePoint", "iconUri": "https://connectoricons-prod.azureedge.net/releases/v1.0.1431/1.0.1431.2301/sharepointonline/icon.png", "dataSources": ["ICT Aanvragen"], "dependencies": [], "dependents": [], "parameterHints": {}, "isOnPremiseConnection": false, "bypassConsent": false, "apiTier": "Standard", "isCustomApiConnection": false } }, "userAppMetadata": { "favorite": "NotSpecified", "includeInAppsList": true }, "isFeaturedApp": false, "bypassConsent": false, "isHeroApp": false, "environment": { "id": "/providers/Microsoft.PowerApps/environments/Default-2ca3eaa5-140f-4175-9563-1172edf9f339", "name": "Default-2ca3eaa5-140f-4175-9563-1172edf9f339" }, "appPackageDetails": { "playerPackage": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/player.msappk?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/player.msappk?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "webPackage": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/web/index.web.html?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/web/index.web.html?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "unauthenticatedWebPackage": { "value": "https://pafeblobprodam.blob.core.windows.net/alt20210118t000000z84a0aa047e784c87b15a6529a8f7ab50/20210118T125458Z/index.web.html" }, "documentServerVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "appPackageResourcesKind": "Split", "packagePropertiesJson": "{\"cdnUrl\":\"https://content.powerapps.com/resource/app\",\"preLoadIdx\":\"https://content.powerapps.com/resource/app/a5ccjkurht6g5/preloadindex.web.html\",\"id\":\"637465712959244709\",\"v\":2.1}" }, "almMode": "Environment", "performanceOptimizationEnabled": true, "unauthenticatedWebPackageHint": "c67d9086-a429-45b8-8b19-91fab5174177", "canConsumeAppPass": true, "executionRestrictions": { "isTeamsOnly": false, "dataLossPreventionEvaluationResult": { "status": "Compliant", "lastEvaluationDate": "2021-01-18T12:54:58.0824718Z", "violationDetails": [] } }, "appPlanClassification": "Standard", "usesPremiumApi": false, "usesOnlyGrandfatheredPremiumApis": true, "usesCustomApi": false, "usesOnPremiseGateway": false, "isCustomizable": true }, "isAppComponentLibrary": false, "appType": "ClassicCanvasApp", displayName: 'App', description: '', appVersion: '2021-01-18T12:54:47Z', owner: 'admin@contoso.com' })); + assert(loggerLogSpy.calledWith(apps[3])); }); it('retrieves information about the specified app using displayName', async () => { @@ -664,19 +962,19 @@ describe(commands.APP_GET, () => { it('renders empty string for missing properties using name', async () => { sinon.stub(request, 'get').callsFake(async (opts) => { - if (opts.url === `https://api.powerapps.com/providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7?api-version=2016-11-01`) { + if (opts.url === `https://api.powerapps.com/providers/Microsoft.PowerApps/apps/9142a1b7-bb93-4a13-aa9b-8651e89f5e5d?api-version=2016-11-01`) { if (opts.headers && opts.headers.accept && (opts.headers.accept as string).indexOf('application/json') === 0) { - return { "name": "5369f386-e380-46cb-82a4-4e18f9e4f3a7", "id": "/providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7", "type": "Microsoft.PowerApps/apps", "tags": { "primaryDeviceWidth": "640", "primaryDeviceHeight": "1136", "sienaVersion": "20210118T125447Z-3.20123.24.0", "deviceCapabilities": "", "supportsPortrait": "true", "supportsLandscape": "false", "primaryFormFactor": "Phone", "publisherVersion": "3.20123.24", "minimumRequiredApiVersion": "2.2.0", "hasComponent": "false", "hasUnlockedComponent": "false", "isUnifiedRootApp": "false" }, "properties": { "appVersion": "2021-01-18T12:54:47Z", "createdByClientVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "minClientVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "owner": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "createdBy": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "lastModifiedBy": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "backgroundColor": "rgba(0, 176, 240, 1)", "backgroundImageUri": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/logoSmallFile?sv=2018-03-28&sr=c&sig=Y5OvBpqU9EXwpXthPre62%2B24zwCNS9ihPfCNmBmuXro%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "teamsColorIconUrl": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z7f1ae936e0c84483a435f047250f9a90/teamsColorIcon.png?sv=2018-03-28&sr=c&sig=ECrnlPPWWirepGA0BwPAfi3RDcNxugeuBajcE9DvJcI%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "teamsOutlineIconUrl": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z7f1ae936e0c84483a435f047250f9a90/teamsOutlineIcon.png?sv=2018-03-28&sr=c&sig=ECrnlPPWWirepGA0BwPAfi3RDcNxugeuBajcE9DvJcI%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "displayName": "App", "description": "", "appUris": { "documentUri": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/document.msapp?sv=2018-03-28&sr=c&sig=bx4dLMgjOurFPWW%2FuanqlJlb1clSqH05cZDPgbEkEno%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/document.msapp?sv=2018-03-28&sr=c&sig=bx4dLMgjOurFPWW%2FuanqlJlb1clSqH05cZDPgbEkEno%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "imageUris": [] }, "createdTime": "2021-01-18T12:54:47.9591484Z", "lastModifiedTime": "2021-01-18T12:54:48.0998249Z", "sharedGroupsCount": 0, "sharedUsersCount": 0, "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7", "appOpenUri": "https://apps.powerapps.com/play/5369f386-e380-46cb-82a4-4e18f9e4f3a7?tenantId=2ca3eaa5-140f-4175-9563-1172edf9f339&hint=c67d9086-a429-45b8-8b19-91fab5174177", "connectionReferences": { "c189738b-6a2d-4713-939d-e2ed35101124": { "id": "/providers/microsoft.powerapps/apis/shared_sharepointonline", "displayName": "SharePoint", "iconUri": "https://connectoricons-prod.azureedge.net/releases/v1.0.1431/1.0.1431.2301/sharepointonline/icon.png", "dataSources": ["ICT Aanvragen"], "dependencies": [], "dependents": [], "parameterHints": {}, "isOnPremiseConnection": false, "bypassConsent": false, "apiTier": "Standard", "isCustomApiConnection": false } }, "userAppMetadata": { "favorite": "NotSpecified", "includeInAppsList": true }, "isFeaturedApp": false, "bypassConsent": false, "isHeroApp": false, "environment": { "id": "/providers/Microsoft.PowerApps/environments/Default-2ca3eaa5-140f-4175-9563-1172edf9f339", "name": "Default-2ca3eaa5-140f-4175-9563-1172edf9f339" }, "appPackageDetails": { "playerPackage": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/player.msappk?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/player.msappk?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "webPackage": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/web/index.web.html?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/web/index.web.html?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "unauthenticatedWebPackage": { "value": "https://pafeblobprodam.blob.core.windows.net/alt20210118t000000z84a0aa047e784c87b15a6529a8f7ab50/20210118T125458Z/index.web.html" }, "documentServerVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "appPackageResourcesKind": "Split", "packagePropertiesJson": "{\"cdnUrl\":\"https://content.powerapps.com/resource/app\",\"preLoadIdx\":\"https://content.powerapps.com/resource/app/a5ccjkurht6g5/preloadindex.web.html\",\"id\":\"637465712959244709\",\"v\":2.1}" }, "almMode": "Environment", "performanceOptimizationEnabled": true, "unauthenticatedWebPackageHint": "c67d9086-a429-45b8-8b19-91fab5174177", "canConsumeAppPass": true, "executionRestrictions": { "isTeamsOnly": false, "dataLossPreventionEvaluationResult": { "status": "Compliant", "lastEvaluationDate": "2021-01-18T12:54:58.0824718Z", "violationDetails": [] } }, "appPlanClassification": "Standard", "usesPremiumApi": false, "usesOnlyGrandfatheredPremiumApis": true, "usesCustomApi": false, "usesOnPremiseGateway": false, "isCustomizable": true }, "isAppComponentLibrary": false, "appType": "ClassicCanvasApp" }; + return apps[4]; } } throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, name: '5369f386-e380-46cb-82a4-4e18f9e4f3a7' } }); - assert(loggerLogSpy.calledWith({ "name": "5369f386-e380-46cb-82a4-4e18f9e4f3a7", "id": "/providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7", "type": "Microsoft.PowerApps/apps", "tags": { "primaryDeviceWidth": "640", "primaryDeviceHeight": "1136", "sienaVersion": "20210118T125447Z-3.20123.24.0", "deviceCapabilities": "", "supportsPortrait": "true", "supportsLandscape": "false", "primaryFormFactor": "Phone", "publisherVersion": "3.20123.24", "minimumRequiredApiVersion": "2.2.0", "hasComponent": "false", "hasUnlockedComponent": "false", "isUnifiedRootApp": "false" }, "properties": { "appVersion": "2021-01-18T12:54:47Z", "createdByClientVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "minClientVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "owner": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "createdBy": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "lastModifiedBy": { "id": "88e85b64-e687-4e0b-bbf4-f42f5f8e674e", "displayName": "Contoso Admin", "email": "admin@contoso.com", "type": "User", "tenantId": "2ca3eaa5-140f-4175-9563-1172edf9f339", "userPrincipalName": "admin@contoso.com" }, "backgroundColor": "rgba(0, 176, 240, 1)", "backgroundImageUri": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/logoSmallFile?sv=2018-03-28&sr=c&sig=Y5OvBpqU9EXwpXthPre62%2B24zwCNS9ihPfCNmBmuXro%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "teamsColorIconUrl": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z7f1ae936e0c84483a435f047250f9a90/teamsColorIcon.png?sv=2018-03-28&sr=c&sig=ECrnlPPWWirepGA0BwPAfi3RDcNxugeuBajcE9DvJcI%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "teamsOutlineIconUrl": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z7f1ae936e0c84483a435f047250f9a90/teamsOutlineIcon.png?sv=2018-03-28&sr=c&sig=ECrnlPPWWirepGA0BwPAfi3RDcNxugeuBajcE9DvJcI%3D&se=2021-04-03T02%3A12%3A49Z&sp=rl", "displayName": "App", "description": "", "appUris": { "documentUri": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/document.msapp?sv=2018-03-28&sr=c&sig=bx4dLMgjOurFPWW%2FuanqlJlb1clSqH05cZDPgbEkEno%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z6c2a80eb28694f6d8ded45d116516cfe/document.msapp?sv=2018-03-28&sr=c&sig=bx4dLMgjOurFPWW%2FuanqlJlb1clSqH05cZDPgbEkEno%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "imageUris": [] }, "createdTime": "2021-01-18T12:54:47.9591484Z", "lastModifiedTime": "2021-01-18T12:54:48.0998249Z", "sharedGroupsCount": 0, "sharedUsersCount": 0, "appOpenProtocolUri": "ms-apps:///providers/Microsoft.PowerApps/apps/5369f386-e380-46cb-82a4-4e18f9e4f3a7", "appOpenUri": "https://apps.powerapps.com/play/5369f386-e380-46cb-82a4-4e18f9e4f3a7?tenantId=2ca3eaa5-140f-4175-9563-1172edf9f339&hint=c67d9086-a429-45b8-8b19-91fab5174177", "connectionReferences": { "c189738b-6a2d-4713-939d-e2ed35101124": { "id": "/providers/microsoft.powerapps/apis/shared_sharepointonline", "displayName": "SharePoint", "iconUri": "https://connectoricons-prod.azureedge.net/releases/v1.0.1431/1.0.1431.2301/sharepointonline/icon.png", "dataSources": ["ICT Aanvragen"], "dependencies": [], "dependents": [], "parameterHints": {}, "isOnPremiseConnection": false, "bypassConsent": false, "apiTier": "Standard", "isCustomApiConnection": false } }, "userAppMetadata": { "favorite": "NotSpecified", "includeInAppsList": true }, "isFeaturedApp": false, "bypassConsent": false, "isHeroApp": false, "environment": { "id": "/providers/Microsoft.PowerApps/environments/Default-2ca3eaa5-140f-4175-9563-1172edf9f339", "name": "Default-2ca3eaa5-140f-4175-9563-1172edf9f339" }, "appPackageDetails": { "playerPackage": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/player.msappk?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/player.msappk?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "webPackage": { "value": "https://pafeblobprodam.blob.core.windows.net:443/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/web/index.web.html?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl", "readonlyValue": "https://pafeblobprodam-secondary.blob.core.windows.net/20210118t000000z1e14514d87e148ef915413781752b174/bda64b54-eb93-4ca8-b1a7-d6f85536c985/web/index.web.html?sv=2018-03-28&sr=c&sig=TwHX9CQJk8KEC6sjIWvYkMJ60v7jY%2FH534DYfL7tyAw%3D&se=2021-02-17T00%3A00%3A00Z&sp=rl" }, "unauthenticatedWebPackage": { "value": "https://pafeblobprodam.blob.core.windows.net/alt20210118t000000z84a0aa047e784c87b15a6529a8f7ab50/20210118T125458Z/index.web.html" }, "documentServerVersion": { "major": 3, "minor": 20123, "build": 24, "revision": 0, "majorRevision": 0, "minorRevision": 0 }, "appPackageResourcesKind": "Split", "packagePropertiesJson": "{\"cdnUrl\":\"https://content.powerapps.com/resource/app\",\"preLoadIdx\":\"https://content.powerapps.com/resource/app/a5ccjkurht6g5/preloadindex.web.html\",\"id\":\"637465712959244709\",\"v\":2.1}" }, "almMode": "Environment", "performanceOptimizationEnabled": true, "unauthenticatedWebPackageHint": "c67d9086-a429-45b8-8b19-91fab5174177", "canConsumeAppPass": true, "executionRestrictions": { "isTeamsOnly": false, "dataLossPreventionEvaluationResult": { "status": "Compliant", "lastEvaluationDate": "2021-01-18T12:54:58.0824718Z", "violationDetails": [] } }, "appPlanClassification": "Standard", "usesPremiumApi": false, "usesOnlyGrandfatheredPremiumApis": true, "usesCustomApi": false, "usesOnPremiseGateway": false, "isCustomizable": true }, "isAppComponentLibrary": false, "appType": "ClassicCanvasApp", displayName: 'App', description: '', appVersion: '2021-01-18T12:54:47Z', owner: '' })); + await command.action(logger, { options: { debug: true, name: '9142a1b7-bb93-4a13-aa9b-8651e89f5e5d' } }); + assert(loggerLogSpy.calledWith(apps[4])); }); it('renders empty string for missing properties using displayName', async () => { diff --git a/src/m365/pa/commands/app/app-get.ts b/src/m365/pa/commands/app/app-get.ts index 47fb8e9b31c..3f50d5d493b 100644 --- a/src/m365/pa/commands/app/app-get.ts +++ b/src/m365/pa/commands/app/app-get.ts @@ -97,10 +97,7 @@ class PaAppGetCommand extends PowerAppsCommand { public async commandAction(logger: Logger, args: CommandArgs): Promise { try { if (args.options.name) { - let endpoint = `${this.resource}/providers/Microsoft.PowerApps/apps/${formatting.encodeQueryParameter(args.options.name)}?api-version=2016-11-01`; - if (args.options.asAdmin) { - endpoint = `${this.resource}/providers/Microsoft.PowerApps/scopes/admin/environments/${formatting.encodeQueryParameter(args.options.environmentName!)}/apps/${formatting.encodeQueryParameter(args.options.name)}?api-version=2016-11-01`; - } + const endpoint = `${this.resource}/providers/Microsoft.PowerApps${args.options.asAdmin ? '/scopes/admin/environments/' + formatting.encodeQueryParameter(args.options.environmentName!) : ''}/apps/${formatting.encodeQueryParameter(args.options.name)}?api-version=2016-11-01`; const requestOptions: CliRequestOptions = { url: endpoint,